IF function a bit It has three pieces called arguments The f
IF function a bit. It has three pieces (called \"arguments\"). The first argument tests a condition. The second tells Excel to do if this condition is true. The third argument tells Excel what to do if the condition is not true. For example, if you wanted to see if the employee worked over 40 hours (and hours is in cell A1), you could say: =IF(A1>=40 If this is true, then you know they worked 40 hours of regular time, so you add this --- =IF(A1>=40,40 If this is not true, then the number of hours they did work is in A1: =IF(A1>=40,40,A1) Anybody has another example that explains the IF function? What are the arguments in the payroll example?
Solution
For example we have to use IF function to calculate a 2% bonus for all sales over $20,000 this month.
The first argument is a logical test. A logical test is any expression that will result in a value of TRUE or FALSE. For example, A2>20000 is a logical test. The next argument is a value or formula that should be used if the logical test is true. The final argument is a value or formula to be used when the logical test is not true.
The formula =IF (A2>20000, 0.02*A2, 0)
If the revenue in A2 is greater than 20,000 then 2% of A2, otherwise 0.
The formula will not pay a bonus for someone who sold exactly $20,000. If such a sale should get a bonus, then use =IF (A2>=20000, 0.02*A2, 0).
In deciding the payroll, the IF functions could be used in the following manner:
Let say D2=hours worked
E2= REGULAR RATE
F2= OVERTIME RATE
We need to calculate how ,much our employees will be paid at the regular rate, at or below 40 hours for the pay period then the formula would be =IF(D2>=40,40*E2,D2*E2)
