IF


Returns one of two values, depending on a test condition.

Syntax:

IF(test, value1, value2) where:

test is or refers to a logical value or expression that returns a logical value (TRUE or FALSE). value1 is the value that is returned by the function if test yields TRUE. value2 is the value that is returned by the function if test yields FALSE.

If value2 is omitted it is assumed to be FALSE; if value1 is also omitted it is assumed to be TRUE.

Example:

IF(A1>5, 100, "too small")

returns the number 100 if A1 is greater than 5, and the text "too small" otherwise.

IF(1>2, "nonsense")

returns FALSE - because value2 has been omitted and 1 is not greater than 2.

IF(2>1)

returns TRUE - because both value1 and value2 have been omitted and 2 is more than 1.

IF(1=2, 1/0, SQRT(4))

returns 2, the square root of 4. IF() only calculates the value chosen - in this case 1/0 would give a #DIV/0! error, but is not calculated.


Application:

Here is an application of the IF function.


Let's imagine you're a manager at a company and you're reviewing employee sales performance. You want to give a bonus to any employee who has sold more than $10,000 worth of products.


Scenario: Determining Employee Bonuses Based on Sales Performance


Function: IF


Purpose: To check if an employee's total sales exceed a certain threshold ($10,000) and then assign a "Bonus" or "No Bonus" status accordingly.

Employee Name

Total Sales

Bonus Status

A
B
C
1
Alice Smith
$12,500.00
Bonus
2
Bob Johnson
$8,900.00
No Bonus
3
Carol White
$10,100.00
Bonus
4
David Lee
$9,500.00
No Bonus
5
Emily Chen
$15,000.00
Bonus

How the Conditional Function Works:

  1. Identify the Target Cell: You would designate a specific cell where you want the result of this decision to appear. Let's call this our "Bonus Status" cell, specifically the one corresponding to Alice Smith.
  2. Input the Rule: You would then input a rule or formula into this "Bonus Status" cell. The rule would look like this:
    IF(B1 > 10000, "Bonus", "No Bonus")
  3. Explanation of the Rule:
    • IF(...): This indicates that a decision needs to be made based on a condition.
    • B1 > 10000: This is the condition being evaluated. It asks: "Is the value in cell B2 (which holds Alice Smith's Total Sales) greater than 10,000?"
    • "Bonus": This is the outcome if the condition is true. If Alice's total sales in cell B2 are indeed greater than 10,000, then the "Bonus Status" cell will display the text "Bonus".
    • "No Bonus": This is the outcome if the condition is false. If Alice's total sales in cell B2 are not greater than 10,000, then the "Bonus Status" cell will display the text "No Bonus".
  4. Applying the Rule to Other Entries: After setting this rule for Alice Smith's entry, you would then replicate this rule for each subsequent employee. For Bob Johnson, you would place a similar rule in his "Bonus Status" cell (C2), but this time referencing his "Total Sales" cell (B2). You would continue this process for Carol White (referencing B3 in C3), David Lee (B4 in C4), and Emily Chen (B5 in C5). Each "Bonus Status" cell would contain the IF rule, adapted to check the sales figure in its corresponding "Total Sales" cell.




This page is protected by Google reCAPTCHA. Privacy - Terms.
 
Built using Zapof