Tuesday, July 8, 2008

IF() and Nested IF() Functions

IF(Test; Then_value; Otherwise_value)

Test is any value or expression that can be TRUE or FALSE.

Then_value (optional) is the value that is returned if the logical test is TRUE.

Otherwise_value (optional) is the value that is returned if the logical test is FALSE.


See screen shot below.



Sometimes you may need more than one IF() function. You can nest more than one IF() function together. Here is an example of a teachers grade sheet that wants to place a letter grade in column B based on the grading scale table and the student's numerical average in column C.


If the first logical test is true then it returns the value in A15.


If it is false it executes the next IF statement and so on until it gets to a true logical statement.


See the screen shot below.


You can click on either image for a larger view.


Also, notice the absolute reference ($). This is so when I copy the formulas down for the other students, It references the same table for the grading scale for all students.


You can download this file. Click on "Spreadsheet Function Files" under "Links" on the right hand side of the page.

No comments:

Relax. Kick your shoes off and watch a video.