Excel If Function PDF
Excel If Function PDF
Excel - IF Function
1/3
Excel IF Function
The logical functions in Excel are a small
group consisting of six functions
These functions are noted for their black-orwhite results
A logical function can return only one of two
values: TRUE or FALSE
Excel IF Function
The operators in the logical_test of the IF
function is may be:
=
<>
>
>=
<
<=
Equals to
Not Equals to
Greater than
Greater than or equal to
Less than
Less than or equal to
100<>100
3*6>=2^3
Excel IF Function
The most common and powerful of the logical
functions in Excel is the IF function
This function is particularly powerful because it
can test for a particular condition in the
worksheet and:
do a calculation if the condition is TRUE; or
another calculation if the condition is FALSE
Excel IF Function
The format of the IF function is:
IF(logical_test, value_if_true, value_if_false)
logical_test is any value or expression that can be evaluated to
TRUE or FALSE
value_if_true is the value that is returned
if logical_test is TRUE
value_if_false is the value that is returned
if logical_test is FALSE
value_if_true and/or value_if_false can be another formula
returns FALSE
returns TRUE
Excel IF Function
Consider the following IF function:
=IF(B2>=1000,100,50)
If the logical_test is TRUE, or in other words if the value of B2 is
greater than or equal to 1000, than the function returns a value
of 100
If the logical_test is FALSE, or in other words if the value of B2
is not greater than or equal to 1000, than the function returns a
value of 50
Excel IF Function
Consider the following IF function:
=IF(B2>=1000,B2*0.1,B2*0.05)
If the Logical_test is TRUE, or in other words if the value of B2
is greater than or equal to 1000, than the function returns 10%
of B2
If the Logical_test is FALSE, or in other words if the value of B2
is not greater than or equal to 1000, than the function returns
5% of B2
CIVL 1112
Excel - IF Function
Excel IF Function
Consider the following IF function:
=IF(B2>=1000,A $1000 or better, Less than a grand)
If the value of B2 is greater than or equal to 1000, than the
function returns the string A $1000 or better
2/3
Excel IF Function
IF(Score>89,"A",IF(Score>79,"B",IF(Score>69,"C",
IF(Score>59,"D","F"))))
If the first logical_test (Score>89) is TRUE, "A" is returned
If the first logical_test is FALSE, the second IF statement is
evaluated
If the second logical_test (Score>79) is TRUE, B" is returned
Excel IF Function
Consider the following IF function:
=IF(A10=100,SUM(B5:B15),"")
If the value of A10 is equal to 100, than the function returns the
sum of the values in cells B5 to B15
Returns TRUE
if all the logical arguments are TRUE
If the value of A10 is not equal to 100, than the function returns
a blank string
Returns FALSE
if one or more arguments is FALSE
Up to 30 conditions you want to test that can be
either TRUE or FALSE
Excel IF Function
Suppose you want to assign letter grades to numbers
referenced by the name Score. See the following
table.
If Score is
Greater than 89
From 80 to 89
From 70 to 79
From 60 to 69
Less than 60
Then return
A
B
C
D
F
IF(Score>89,"A",IF(Score>79,"B",IF(Score>69,"C",
IF(Score>59,"D","F"))))
CIVL 1112
Excel - IF Function
Excel OR Function
The format of the OR function is:
3/3
OR(logical1, logical2, . . . )
Returns TRUE
if any logical arguments is TRUE
Returns FALSE
if all arguments are FALSE
Up to 30 conditions you want to test that can be
either TRUE or FALSE
AND
OR
NOT
FALSE
TRUE
Wx 2
y
3a x
6EI
for x a
Wx 2
3x a
6EI
for x a
y
where
W is in cell A4
E is in cell A5
I is in cell A6
a is in cell B6
x is in cell B8
Wx 2
3a x
6EI
for x a
Wx 2
3x a
6EI
for x a
a is in cell B6
x is in cell B8
=IF(B8<=B6, A4*B8^2*(3*B6-B8)/(6*A5*A6),
A4*B8^2*(3*B8-B6)/(6*A5*A6))
Questions?