Professional Documents
Culture Documents
com
1 de 3
http://office.microsoft.com/en-us/excel-help/if-HP005209118.aspx
IF
Returns one value if a condition you specify evaluates to TRUE and another value if it evaluates
to FALSE.
Show All
Data
50
Formula
Description (Result)
=IF(A2<=100,"Within
budget","Over budget")
=IF(A2=100,SUM(B5:B15),"")
Example 2
The example may be easier to understand if you copy it to a blank worksheet.
How to copy an example
A
12/20/2012 12:14 AM
IF - Excel - Office.com
2 de 3
http://office.microsoft.com/en-us/excel-help/if-HP005209118.aspx
Actual Expenses
Predicted Expenses
1500
900
500
900
500
925
Formula
Description (Result)
=IF(A2>B2,"Over Budget","OK")
=IF(A3>B3,"Over Budget","OK")
Example 3
The example may be easier to understand if you copy it to a blank worksheet.
How to copy an example
A
1
Score
45
90
78
Formula
Description (Result)
=IF(A2>89,"A",IF(A2>79,"B",
IF(A2>69,"C",IF(A2>59,"D","F"))))
=IF(A3>89,"A",IF(A3>79,"B",
IF(A3>69,"C",IF(A3>59,"D","F"))))
=IF(A4>89,"A",IF(A4>79,"B",
IF(A4>69,"C",IF(A4>59,"D","F"))))
In the preceding example, the second IF statement is also the value_if_false argument to the first IF statement.
Similarly, the third IF statement is the value_if_false argument to the second IF statement. For example, if the first
logical_test (Average>89) is TRUE, "A" is returned. If the first logical_test is FALSE, the second IF statement is
evaluated, and so on.
The letter grades are assigned to numbers using the following key.
IF SCORE IS
THEN RETURN
Greater than 89
From 80 to 89
From 70 to 79
From 60 to 69
Less than 60
Example 4
In this example, the LOOKUP function is used instead of the IF function because there are thirteen conditions to
test.
The example may be easier to understand if you copy it to a blank worksheet.
How to copy an example
A
1
Score
45
90
78
12/20/2012 12:14 AM
IF - Excel - Office.com
3 de 3
http://office.microsoft.com/en-us/excel-help/if-HP005209118.aspx
Formula
Description (Result)
=LOOKUP(A2,{0,60,63,67,70,73,77,80,83,87,90,93,97},
{"F","D-","D","D+","C-","C","C+","B-","B","B+","A-","A","A+"})
=LOOKUP(A3,{0,60,63,67,70,73,77,80,83,87,90,93,97},
{"F","D-","D","D+","C-","C","C+","B-","B","B+","A-","A","A+"})
=LOOKUP(A4,{0,60,63,67,70,73,77,80,83,87,90,93,97},
{"F","D-","D","D+","C-","C","C+","B-","B","B+","A-","A","A+"})
Site Directory
Contact Us
Submit Feedback
Legal
Trademarks
Accessibility
12/20/2012 12:14 AM