How to Use Multiple IF Statements in Excel (Step-by-Step)

The IF function is an awesome logical function of Excel. When used the right way, it will offer results that will leave you fascinated 🤩

The IF function, by default, tests a single logical condition. But with the classic nesting of the IF function, you can make it test multiple conditions at the same time.

Not only that, but you can also run it under the AND & the OR logics. How?

To learn that, continue reading and make sure you’ve downloaded our free sample workbook for this guide here. It will help you practice the examples discussed below 📩

What are nested IF functions?

A nested IF function is where multiple IF functions are nested within each other.

Practically, it’s an IF function nested in the place of the value_if_false argument of another IF Function. And so on.

A classic nested IF function looks like the one below 👇

IF (logical_criteria1, value_if_true, IF (logical_criteria2, value_if_true, IF (logical_criteria3, value_if_true, value_if_false ) ) )

In place of the value_if_false argument of each IF function, another IF function is nested.

Pro Tip!

Seems like a complex formula? Here’s how it works:

  • Excel evaluates the first logical test. If it is true, Excel returns the value_if_true of the first IF function.
  • If it turns false, Excel runs the second logical test. If the second logical test turns true, Excel returns the value_if_true of the second IF function.
  • If the second logical test turns false, Excel runs the third logical test, and the cycle continues until the last IF function 🔁

Under the AND logic, a classic nested IF function looks like this:

IF ( logical_criteria1, IF ( logical_criteria2, value_if_true, value_if_false), value_if_false)

This time, an IF function is nested in place of the value_if_true argument of each IF function.

Pro Tip!

Here’s how this function works 💭

  • Excel evaluates the first logical test. If it is false, Excel returns the value_if_false for of first IF function. But if it is true, Excel runs the second logical test.
  • If the second logical test turns false, Excel returns the value_if_false for of second IF function. And if the logical test of the second IF function turns true, Excel returns the value_if_true of the second function.

Multiple IF statements with AND logic (restrictive)

AND logic means that the IF function must return the value_if_true only if all the specified conditions are true. Let’s run an example to see how this works.

XYZ institute has a stern criterion for admitting students 🎓

Data of students

For any student to get admission, he must:

  • Be taller than 5 feet; and
  • Have an IQ score higher than 140.

Let’s write the IF function to test both these conditions with the AND logic 💪

  1. Write the IF function as follows:

=  IF (B2>5

Height in column B > 5

The first criterion of B2 > 5 tells Excel to check if the value in Cell B2 (the height) is greater than 5.

  1. As the value_if_true, nest another IF function.
  2. For the logical test of the second IF function, write the second condition (IQ score > 140).

=  IF (B2>5, IF (C2>140

Second IF function

The logical test of C2 > 140 tells Excel to check if the value in Cell C2 (IQ score) is greater than 140 🧠

  1. Write the value_if_true for the second logical test.

=  IF (B2>5, IF (C2>140, “Admission Granted”

Writing the value_if_true

We have written the value_if_true as “Admission Granted” in double quotation marks.

  1. Write the value_if_false for the second logical test.

=  IF (B2>5, IF (C2>140, “Admission Granted”, “Rejected due to IQ score”

Writing the value_if_false

As the value_if_false of the second IF function (logical test of C2>140), we are writing “Rejected due to IQ score”

  1. Close the parenthesis (we are done writing the nested IF function) and write the value_if_false of the first IF function.

=  IF (B2>5, IF (C2>140, “Admission Granted”, “Rejected due IQ score”), “Rejected due to height”)

Value_if_false of the IFS function
  1. That’s all – Hit Enter.
The IF function runs the AND logic

Excel returns “Admission Granted“, and the results make much sense.

Student A meets both the criteria for Scholarship: he is 5.4 feet tall and has a whopping IQ of 150 🤩

  1. Drag and drop the results to the entire list.
Results for the whole list

There we go! We have the admission results for the entire list.

Multiple IF statements with OR logic (open)

We’ve seen how the IF function works under the AND logic. Now let’s see if the same works under the OR logic.

OR logic means that the IF function must return the value_if_true if any of the specified conditions are true 🧐

Kasper Langmann, Microsoft Office Specialist

We are going with the same previous example. But this time, for any student to get admission, he must:

  • Be taller than 5 feet; or
  • Have an IQ score higher than 140.

Let’s write the IF function to test both these conditions with the OR logic.

  1. Write the IF function with the first logical test (Height > 5 feet).

=  IF (B2>5,

First IF condition
  1. Define the value_if_true of the first IF function.

=  IF (B2>5, “Admission Granted”,

The value_if_true of the first IF function

We are setting it to “Admission Granted” 📔

  1. As the value_if_true, nest in another IF function and write the second logical test (Height > 140).

=  IF (B2>5, “Admission Granted”, IF (C2>140,

Nesting another IF function
  1. Write the value_if_true for the second IF function.

=  IF (B2>5, “Admission Granted”, IF (C2>140, “Admission Granted”

Writing the value_if_true

We are again setting it to “Admission Granted” as any student who meets any of these criteria will get admission 🚀

  1. Write the value_if_false for the second IF function.

=IF(B2>5,”Admission Granted”, IF(C2>140, “Admission Granted”, “Rejected”)

Writing the value_if_false of the second IF

We will get the value_if_false (“Rejected”) under the OR logic only if both criteria fail to meet. So there’s no distinction between being Rejected due to IQ or Height. Let’s simplify it to “Rejected“.

  1. Close the second IF function with parenthesis.
  2. And then, add another parenthesis to close the first IF function too.

=IF(B2>5,”Admission Granted”, IF(C2>140, “Admission Granted”, “Rejected”))

  1. That’s all – Hit Enter 🤟
The IF function runs the OR logic

Excel again returns “Admission Granted“, but this time Student A didn’t meet both criteria.

He is 5.4 feet tall (taller than 5 feet) but only has an IQ of 120 (less than 140). This is because this time we were running the OR logic.

  1. Drag and drop the results to the entire list.
Results for the whole list

And here we have the admission results for the entire list with the OR logic 🎯

Nested IF formula with both AND + OR logic

Now let’s try running a function with the AND & OR logic simultaneously. Yes, that might sound a little confusing but, you’d enjoy it to the core.

To do this, we will still use the same dataset as above with a little change 👀

Data with height, IQ, and weight

Only those students shall stand eligible for admission who:

  • Have an IQ of more than 140; AND
  • Are taller than 5 feet; OR
  • Have a weight lesser than 80 Kg.

The story has a little twist – the admission criteria now necessitate an IQ score of more than 140. And of the other two conditions, anyone needs to be met 🥇

Let’s write the IF function to test both these conditions with the AND & OR logic.

  1. Start writing the IF function with the AND condition first (the condition that must be met).

=  IF (B2>140,

The AND condition

The mandatory condition for admission is an IQ score higher than 140 so we have written that first.

  1. Nest another IF function as the value_if_true of the first IF function.
  2. Write the logical test for the second IF function as C2>5 (height >5) and define the value_if_true.

=  IF (B2>140, IF (C2>5, “Admission Granted”,

Nested IF statement

Done with the mandatory (AND condition). Now let’s move on to the OR conditions. We will nest them in place of the value_if_false of the last IF function 😎

  1. Nest another IF function as the value_if_false of the second IF function.

=  IF (B2>140, IF (C2>5, “Admission Granted”, IF (D2<80, “Admission Granted”, “Rejected due to Height or Weight”)

Excel multiple IFS

As the third IF function, the logical test is set to less than 80Kgs (D2<80) with the relevant value_if_true and value_if_false.

  1. We are done writing our second and third IF functions. Add two parentheses to close them.
  2. Write the value_if_false of the first IF function to conclude the following formula:

=  IF (B2>140, IF (C2>5, “Admission Granted”, IF (D2<80, “Admission Granted”, “Rejected due to Height or Weight”)), “Rejected due to IQ”)

Multiple ifs excel template
  1. Hit Enter.
The IF function runs the AND & OR logic

Excel again returns “Admission Granted” as Student A 👇

  • Has an IQ score of 150 (more than 140)
  • He is 4.8 feet tall (not more than 5 feet)
  • But he weights 75 Kgs (less than 80 Kgs)

So, he meets the mandatory criteria and one of the two OR criteria – so he’s in.

  1. Drag and drop the results to the entire list.
Results for the whole list

This time the admission results are based on both the AND & OR logic.

Multiple IF statements with the actual AND/OR functions

Did you know? You can also make the IF function run under the AND & OR logic by using the AND & OR functions too. No nesting is needed 🐤

Let’s write the IF function together with the AND function to see which students are granted Admission this time.

For any student to get admission, he must:

  • Be taller than 5 feet; and
  • Have an IQ score higher than 140.

To check that:

  1. Write the AND function as follows:

=  AND(B2>5, C2>140)

Writing the AND function

We have defined both the logical tests (criteria above) as the arguments of the AND function 👩‍🎓

  1. Hit Enter and you will get these results:
AND function results

We get FALSE as one of the above conditions is not met. Student A is not taller than 5 feet.

  1. Wrap the function above in the IF function as follows:

= IF (AND (B2>5, C2>140), “Admission Granted”, “Rejected”)

AND function wrapped in the IF function
  1. Hit Enter.
Results of IF together with AND

Same as the nested IF works under the AND Logic. You can do the same for the OR logic using the OR function 💁‍♀️

  1. Simply replace the AND function in the formula below with OR.

= IF (OR (B2>5, C2>140), “Admission Granted”, “Rejected”)

OR function wrapped in the IF function
  1. Hit Enter.
IF statement together with OR

With the OR function, the answer is “Admission Granted”.

Student A meets one condition: he has an IQ score higher than 140 ✌

That’s it – Now what?

The guide above has taught us how to nest multiple IF functions together under the OR & AND logic. You can do so by using the AND & OR functions but, that’s not necessary.

You can also use multiplication and addition operators to make this happen. Hope you enjoyed learning about nesting the IF function 🧐

If you did, let me tell you there’s so much more for you to learn about Excel functions. The Excel functions library is full of similar amazing functions.

To begin learning, I suggest you go with the basic Excel functions like the VLOOKUP, SUMIF, and IF functions.

Click here to register for my 30-minute free email course that will walk you through these (and many more) functions of Excel.

Other resources

IF functions are so versatile that you’d find a list of functions paired with them in Excel by default. Like the AVERAGEIF function, SUMIF function, and COUNTIF function.

Read our other blogs on them to learn how to use them.

Frequently asked questions

By default, no.

However, you can use the IF function to evaluate up to 64 conditions by nesting the IF functions into one another. To test two conditions using the IF function, write it as follows:

= IF ( logical test, value_if_true, IF ( logical test, value_if_true, value_if_false)

Nest another IF function in place of the value_if_true argument of the first IF function.