The Excel IF Function checks a condition that must be either true or false. If the condition is true, the function returns one value; if the condition is false, the function returns another value.
The function has three arguments: the condition you want to check, the value to return if the condition is true, and the value to return if the condition is false.
Here is the Excel IF()Syntax:
IF(Logical_test, Ation_if_true, Action_if_false)
Logical _test
The logical_test evaluates an expression to see if it passes the test, i.e. is TRUE or does not pass the test, i.e. is FALSE.
Action_if_true
Action_if_true can be a value or an operation. Whichever, the result is placed in the cell that contains the IF ( ) Function if the logical_test is true.
Action_if_false
Action_if_false can be a value or an operation. Whichever, the result is placed in the cell that contains the IF ( ) Function if the logical_test is false.
To demonstrate the Excel IF function
Lets look at an example for calculating a bonuses based on total sales. A company offers its salesman a 5% bonus if the value of the total sales is below $5,000 per month. If the total sales exceed $5,000 per month, the bonus will be 10%.
When translated into the IF ( ) function it looks like the following:
IF(TotalSales>5000,TotalSales * 10%, TotalSales * 5%)
· Enter the following data for column A and column B accordingly.
· Click on the cell to contain the IF( ) function. In this case, cells C2.
· From the Insert menu, click on Function…
OR press the Shift+F3
· Enter B2 > 5000 into the Logical_test text area. Press the Tab key.
· Enter 10% into the Value_if_true text area. Press the Tab key.
· Enter 5% into the Value_if_false text area. Click OK.
· Follow the same procedure for the cells C3 to C6.
Note: Every time, you just need to change the data from B2 to B6, then the bonus will be automatically calculated.
0 comments:
Post a Comment