Get instant live expert help with Excel or Google Sheets
“My Excelchat expert helped me in less than 20 minutes, saving me what would have been 5 hours of work!”

Post your problem and you’ll get expert help in seconds.

Your message must be at least 40 characters
Our professional experts are available now. Your privacy is guaranteed.
All articles IF Nested IF Function Example

Nested IF Function Example

Excel allows a user to use a multiple nested logical expression in order to check if conditions are true. This is possible by using the nested IF function which returns Boolean TRUE or FALSE as a result. This step by step tutorial will assist all levels of Excel users in using the nested IF function.

Figure 1. The result of the nested IF function

Syntax of the IF Formula

The generic formula for the IF function is:

=IF(logical_test, value_if_true, value_if_false)

The parameters of the IF function are:

  • logical_test – a logical expression that we want to check
  • value_if_true – a value which the function returns if a logical_test is TRUE
  • value_if_false – a value which the function returns if a logical_test is FALSE.

Setting up Our Data for the Nested IF Function

The first table consists of 3 columns: “Student” (column B), “Ponts” (column C) and “Grade” (column D). The second table is the grade scale and has 2 columns: “Points” (column F) and “Grade” (column G). Based on a number of the points, we want to get a grade for each student in column D, using the points scale in the second table.

Figure 2. The tables for the nested IF function example

Get a Grade Based on Points Using the Nested IF Function

In our example, to get a grade in the cell D3 for Michael, who has 76 points. In order to do this, we need to check the second table with several nested IF functions.

The formula looks like:

=IF(C3<65,6, IF(C3<75,7, IF(C3<85,8, IF(C3<95,9, IF(C3<100,10)))))

The parameter logical_test for the first IF is C3<65, The value_if_true is the grade 6.If it’s false we need to check further in the next points scale. Therefore, the value_if_false is IF(C3<75,7, IF(C3<85,8, IF(C3<95,9, IF(C3<100,10)))). In this way, we check for every points scale, until 100 points.

To apply the nested IF function, we need to follow these steps:

  • Select cell D3 and click on it
  • Insert the formula: =IF(C3<65,6, IF(C3<75,7, IF(C3<85,8, IF(C3<95,9, IF(C3<100,10)))))
  • Press enter
  • Drag the formula down to the other cells in the column by clicking and dragging the little “+” icon at the bottom-right of the cell.

Figure 3. Using the nested IF function to get a grade for the number of points

First, we check if C3 (76 points) is less than 65. As this is not true, we go to value_if_false and check the next IF. Here we check if C3 is less than 75. Again, this is not true, so we are going to value_if_false and entering the third IF function. Now, we check if C3 is less than 85. This is true, so the grade in D3 is 8 (value_if_true of the third IF function).

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Solution examples
Could you help me by explaining the IF function?
Solved by G. L. in 24 mins
I have a question about Conditional Formatting. =IF('Sheet1'!A1="X",IF('Sheet1'!B1="Y", TRUE, FALSE),FALSE) the set the cell background to red. I would like to make it so that if Sheet1'!B1="Z" I set the back to blue. How can I achieve this.
Solved by B. F. in 39 mins
I need to find out if the 2018 yearly sales goals were met if the yearly sales were $25,000 or more using an IF logical function and to set the formula to return a value of YES if met, and NO if not
Solved by A. A. in 18 mins
I filtered data in column A (it is labeled ID #) of a data set. On my next worksheet, column A is also the ID #, but it is a different data set. I want to filter the ID #'s the same for the two sheets, but how do I do that being that I am working with two different sets of data?
Solved by V. H. in 22 mins
i want to create a very simple if function in a cell which is, if one cell is less than 1250, then the automatic value in the current cell is 250, dead easy, for someone who knows! Thank you.
Solved by A. H. in 14 mins

Leave a Comment

avatar

Subscribe to Excelchat.co

Get updates on helpful Excel topics

Subscribe to Excelchat.co

Did this post not answer your question?
Get a solution from connecting with the expert

Another blog reader asked this question today on Excelchat:

Post your problem and you’ll get expert help in seconds.

Your message must be at least 40 characters
Our professional experts are available now. Your privacy is guaranteed.
Trusted by people who work at
Amazon.com, Inc
Facebook, Inc
Accenture PLC
Siemens AG
Macy's
The Allstate Corporation
United Parcel Service
Dell Inc