Click to edit Master title style
1
Click to edit Master title style
Section Header01
Subtitle
2
2
THE
Click to edit IF FUNCTION
Master title style
1. The IF function is a logical function used for making decisions based on some
condition(s)
Conditions have to result in Boolean values. (relational expressions, true/false)
Lends more flexibility since the results can be something else besides a simple True -
False value
If your total points are less than 600 then display “Fail” in the cell otherwise display
“Pass”
A statement that checks the content of a cell against a given expression. If the
expression is TRUE the first value is returned. If the expression is
3 FALSE the second
value is returned. 3
THEtitle
Click to edit Master IF FUNCTION
style
SYNTAX
IF(Logical_test, value_if_true , value_if_false)
The IF function has 3 arguments - the first two are required
• First argument <logical_test> : is any value or
expression
that can be evaluated to TRUE or FALSE<condition>
• Second argument: the value that is returned if
logical_test is TRUE (then)
• Third argument: the value that is returned if 4
4
logical_test is False (else) – this argument is optional
An IF function is made up of 3 parts:
Click
• Ato edit Master title style
condition
• What to do if the condition is met
• What to do if the condition is not met.
5
5
Click to edit Master title style
When using the IF function to construct a
test, we can use the following relational
operators:
1. = (equal to)
2. > (greater than)
3. >= (greater than or equal to)
4. < (less than)
5. <= (less than or equal to)
6. <> (not equal to) 6
6
Click to edit Master title style
Example 1 : The numbers in C2 and D2 is compared. If C2 is bigger then display “Yes it
“
is”, if C2 is smaller number then display “No it isn’t”
7
7
Example 2 : There are several different columns, and each row contains the contact
Click to
information for edit Master
one person, title
along with style
the amount of money that person donated. If
anyone gave at least $50, they'll receive a free tote bag. So if a person donated at least
$50, we need to write the words Free Gift in that donor's row.
8
We insert a new column and give title Free Gift. We enter the IF function as
Click to edit Master title style
=IF( condition, if condition is met to display message “Free Gift Bag”, if condition not met
then message to display “NO GIFT BAG”)
If Donation is
greater than
or equal to 50
9
Click to edit Master title style
10
Click to edit Master title style
In the above example :
Let's say our company is based in North Carolina and we want to
know which of our donors are local. Which of the following IF
functions would place the word "Yes" for donors from North Carolina
and "No" for those who live out of state?
A : =IF("NC", "Yes", "No")
B : =(IF E2=NC, "No", "Yes")
C: =IF(E2="NC", "Yes", "No")
D : =IF(E2=NC, "No", "Yes")
11
Whichto
Click ofedit
the following is thestyle
Master title correct formula for
the IF function in Excel?
A : IF (logical_test, value_if_true, value_if_false)
B : =IF (logical_test, value_if_true, value_if_false)
C : =(logical_test, value_if_true, value_if_false)
D : none of these
12
Click
If the to
celledit
B2 isMaster title
68, what willstyle
this IF function give you
as a result?
=IF (B2>60, ''pass'', ''fail‘’)
A : pass
B : fail
C : 60
D : all of these
13
Click to edit Master title style
A2 = 20, B2 = 30, C2 =40
=IF(B2<>C2, A2*10,"")
What value should be returned if the statement
is true?
A : 20
B : 300
C : 200
14
D : 400
Click to edit Master title style
=IF(B5>B4, "Large", "Small")
The value in B5 = 56
The value in B4 = 89
What is the result that this IF statement will return?
A : Large
B : Small
15
Click to edit Master title style
How many parts are there to an IF statement/function?
A :1
B :2
C:3
16