# Multiple IF Statements in Excel (Nested IF Functions)

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 đ©

**Table of Contents**

## 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 đ

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 đȘ

- Write the IF function as follows:

**=Â IF (B2>5**

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

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

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

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

- Write the value_if_true for the second logical test.

**=Â IF (B2>5, IF (C2>140, âAdmission Grantedâ**

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

- Write the value_if_false for the second logical test.

**=Â IF (B2>5, IF (C2>140, âAdmission Grantedâ, âRejected due to IQ scoreâ**

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

- 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â)**

- Thatâs all â Hit Enter.

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 đ€©

- Drag and drop the results to the entire 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_trueifany of the specified conditionsare true đ§

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.

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

**=Â IF (B2>5,**

- Define the value_if_true of the first IF function.

**=Â IF (B2>5, âAdmission Grantedâ,**

We are setting it to âAdmission Grantedâ đ

- 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,**

- Write the value_if_true for the second IF function.

**=Â IF (B2>5, âAdmission Grantedâ, IF (C2>140, âAdmission Grantedâ**

We are again setting it to â**Admission Granted**â as any student who meets any of these criteria will get admission đ

- Write the value_if_false for the second IF function.

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

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**“.

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

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

- Thatâs all â Hit Enter đ€

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.

- Drag and drop the results to the entire 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 đ

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.

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

**=Â IF (B2>140,**

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

- Nest another IF function as the value_if_true of the first IF function.
- 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â,**

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 đ

- 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â)**

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.

- We are done writing our second and third IF functions. Add two parentheses to close them.
- 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â)**

- Hit Enter.

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.

- Drag and drop the results to the entire 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:

- Write the AND function as follows:

**=Â AND(B2>5, C2>140)**

We have defined both the logical tests (criteria above) as the arguments of the AND function đ©âđ

- Hit Enter and you will get these results:

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

- Wrap the function above in the IF function as follows:

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

- Hit Enter.

Same as the nested IF works under the AND Logic. You can do the same for the OR logic using the OR function đââïž

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

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

- Hit Enter.

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.

## 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.