Excel’s IF function can often prove to be very useful. You can use this function to branch to different values or actions depending on a specified condition. The structure of an If function is as follows.
IF (logical test, value if true, value if false)
IF functions are called conditional functions because the value that the function returns will depend on whether or not a specific condition is satisfied. As an example, consider the following function.
IF (A1=10, 5, 1)
This function states that if cell A1 has a value of 10 the cell that contains the function will have the value of 5. But if A1 doesn’t have a value of 10, the cell that contains the function will have a value of 1. In other words, the function reads: if A1 equals 10 then return the number 5, else, return the number 1.
Let’s say that this next IF function is entered into cell B2.
IF (A1<=100, A1*.5, C3*2)
This function states that if the contents of cell A1 is less than or equal to 100, the value in cell B2 will be the value in A1 multiplied by .5, else, the value in B2 will be the value of cell C3 multiplied by 2.
You can insert an IF function by invoking the Insert Function dialogue, and looking under the Logical category, or by typing it directly into the formula bar. The logic of the IF function can be a little confusing until you get used to it. The best way to get comfortable with IF functions is to practice using them.
|