# Excel IF statement with multiple AND/OR conditions, nested IF formulas, and more

In Part 1 of our Excel IF function tutorial, we started to learn the nuts and bolts of the Excel IF function. As you remember, we discussed a few IF formulas for numbers, dates and text values as well as how to write an IF statement for blank and non-blank cells.

However, for powerful data analysis, you may often need to evaluate multiple conditions at a time, meaning you have to construct more sophisticated logical tests using multiple IF functions in one formula. The formula examples that follow below will show you how to do this correctly. You will also learn how to use Excel IF in array formulas and learn the basics of the IFEFFOR and IFNA functions.

## How to use Excel IF function with multiple conditions

In summary, there can be 2 basic types of multiple conditions - with AND and OR logic. Consequently, your IF function should embed an AND or OR function in the logical test, respectively.

• AND function. If your logical test contains the AND function, Microsoft Excel returns TRUE if all the conditions are met; otherwise it returns FALSE.
• OR function. In case you use the OR function in the logical test, Excel returns TRUE if any of the conditions is met; FALSE otherwise.

To better illustrate the point, let's have a look at a few IF examples with multiple conditions.

#### Example 1. Using IF & AND function in Excel

Suppose, you have a table with the results of two exam scores. The first score, stored in column C, must be equal to or greater than 20. The second score, listed in column D, must be equal to or exceed 30. Only when both of the above conditions are met, a student passes the final exam.

The easiest way to make a proper formula is to write down the condition first, and then incorporate it in the logical_test argument of your IF function:

Condition: AND(B2>=20, C2>=30)

IF/AND formula: `=IF((AND(C2>=20, D2>=30)), "Pass", "Fail")`

Easy, isn't it? The formula tells Excel to return "Pass" if a value in column C >=20 AND a value in column D >=30. Otherwise, the formula returns "Fail". The screenshot below proves that our Excel IF /AND function is correct:

Note. Microsoft Excel checks all conditions in the AND function, even if one of the already tested conditions evaluates to FALSE. Such behavior is a bit unusual since in most of programming languages, subsequent conditions are not tested if any of the previous tests has returned FALSE.

In practice, a seemingly correct IF / AND formula may result in an error because of this specificity. For example, the formula `=IF(AND(A2<>0,(1/A2)>0.5),"Good", "Bad")` will return "Divide by Zero Error" (#DIV/0!) if cell A2 is equal to 0. The avoid this, you should use a nested IF function:

`=IF(A2<>0, IF((1/A2)>0.5, "Good", "Bad"), "Bad")`

#### Example 2. Using IF with OR function in Excel

You use the combination of IF & OR functions in a similar way. The difference from the IF / AND formula discussed above is that Excel returns TRUE if at least one of the specified conditions is met.

So, if we modify the above formula in the following way:

`=IF((OR(C2>=20, D2>=30)), "Pass", "Fail")`

Column E will have the "Pass" mark if either the first score is equal to or greater than 20 OR the second score is equal to or greater than 30.

As you see in the screenshot below, our students have a better chance to pass the final exam with such conditions (Scott being particularly unlucky failing by just 1 point : )

More formula examples can be found in Excel IF OR functon.

#### Example 3. Using IF with AND & OR functions

In case you have to evaluate your data based on several sets of multiple conditions, you will have to employ both AND & OR functions at a time.

In the above table, suppose you have the following criteria to evaluate the students' success:

• Condition 1: column C>=20 and column D>=25
• Condition 2: column C>=15 and column D>=20

If either of the above conditions is met, the final exam is deemed passed, otherwise - failed.

The formula might seem tricky, but in a moment, you will see that it is not! You just have to express two conditions as AND statements and enclose them in the OR function since you do not require both conditions to be met, either will suffice:

`OR(AND(C2>=20, D2>=25), AND(C2>=15, D2>=20)`

Finally, use the above OR function as the logical test in the IF function and supply value_if_true and value_if_false arguments. As the result, you will get the following IF formula with multiple AND / OR conditions:

`=IF(OR(AND(C2>=20, D2>=25), AND(C2>=15, D2>=20)), "Pass", "Fail")`

The screenshot below indicates that we've got the formula right:

Naturally, you are not limited to using only two AND/OR functions in your Excel IF formulas. You can use as many logical functions as your business logic requires, provided that:

• In Excel 2016, 2013, 2010 and 2007, your formula includes no more than 255 arguments, and the total length of the formula does not exceed 8,192 characters.
• In Excel 2003 and lower, you can use up to 30 arguments and the total length of your formula shall not exceed 1,024 characters.

## Using multiple IF statements in Excel (nested IF functions)

If you need to create more elaborate logical tests for your data, you can include additional IF statements in the value_if_true and value_if_false arguments of your Excel IF formulas. These multiple IF functions are called nested IF functions and they may prove particularly useful if you want your formula to return 3 or more different results.

Here's a typical example: suppose you want not simply to qualify the students' results as Pass/Fail, but define the total score as "Good", "Satisfactory" and "Poor". For instance:

• Good: 60 or more (>=60)
• Satisfactory: between 40 and 60 (>40 and <60)
• Poor: 40 or less (<=40)

To begin with, you can add an additional column (E) with the following formula that sums numbers in columns C and D: `=C2+D2`

And now, let's write a nested IF function based on the above conditions. It's considered a good practice to start with the most important condition and make your functions as simple as possible. Our Excel nested IF formula is as follows:

`=IF(E2>=60, "Good", IF(E2>40, "Satisfactory", "Poor "))`

As you see, just one nested IF function is sufficient in this case. Naturally, you can nest more IF functions if you want to. For example:

`=IF(E2>=70, "Excellent", IF(E2>=60, "Good", IF(E2>40, "Satisfactory", "Poor ")))`

The above formula adds one more conditions - the total score of 70 points and more is qualified as "Excellent".

## Using Excel IF in array formulas

Like other Excel functions, IF can be used in array formulas. You may need such a formula if you want to evaluate every element of the array when the IF statement is carried out.

For example, the following array SUM/IF formula demonstrates how you can sum cells in the specified range based on a certain condition rather than add up the actual values:

`=SUM(IF(B1:B5<=1,1,2))`

The formula assigns a certain number of "points" to each value in column B - if a value is equal to or less than 1, it equates to 1 point; and 2 points are assigned to each value greater than 1. And then, the SUM function adds up the resulting 1's and 2's, as shown in the screenshot below.

Note. Since this is an array formula, remember to press Ctrl + Shift + Enter to enter it correctly.

## Using IF function together with other Excel functions

Earlier in this tutorial, we've discussed a few IF formula examples demonstrating how to use the Excel IF function with logical functions AND and OR. Now, let's see what other Excel functions can be used with IF and what benefits this gives to you.

#### Example 1. Using IF with SUM, AVERAGE, MIN and MAX functions

When discussing nested IF functions, we wrote the formula that returns different ranking (Excellent, Good, Satisfactory or Poor) based on the total score of each student. As you remember, we added a new column with the formula that calculates the total of scores in columns C and D.

But what if your table has a predefined structure that does not allow any modifications? In this case, instead of adding a helper column, you could add values directly in your If formula, like this:

`=IF((C2+D2)>=60, "Good", IF((C2+D2)=>40, "Satisfactory", "Poor "))`

Okay, but what if your table contains a lot of individual scores, say 5 different columns or more? Summing so many figures directly in the IF formula would make it enormously big. An alternative is embedding the SUM function in the IF's logical test, like this:

`=IF(SUM(C2:F2)>=120, "Good", IF(SUM(C2:F2)>=90, "Satisfactory", "Poor "))`

In a similar fashion, you can use other Excel functions in the logical test of your IF formulas:

IF and AVERAGE:

`=IF(AVERAGE(C2:F2)>=30,"Good",IF(AVERAGE(C2:F2)>=25,"Satisfactory","Poor "))`

The formulas retunes "Good" if the average score in columns C:F is equal to or greater than 30, "Satisfactory" if the average score is between 29 and 25 inclusive, and "Poor" if less than 25.

IF and MAX/MIN:

To find the highest and lowest scores, you can use the MAX and MIN functions, respectively. Assuming that column F is the total score column, the below formulas work a treat:

MAX: `=IF(F2=MAX(\$F\$2:\$F\$10), "Best result", "")`

MIN: `=IF(F2=MIN(\$F\$2:\$F\$10), "Worst result", "")`

If you'd rather have both the Min and Max results in the same column, you can nest one of the above functions in the other, for example:

`=IF(F2=MAX(\$F\$2:\$F\$10) ,"Best result", IF(F2=MIN(\$F\$2:\$F\$10), "Worst result", ""))`

In a similar manner, you can use the IF function with your custom worksheet functions. For example, you can use it with the GetCellColor / GetCellFontColor functions to return different results based on a cell color.

In addition, Excel provides a number of special IF functions to analyze and calculate data based on different conditions.

For example, to count the occurrences of a text or numeric value based on a single or multiple conditions, you can use COUNTIF and COUNTIFS, respectively. To find out a sum of values based on the specified condition(s), use the SUMIF or SUMIFS functions. To calculate the average according to certain criteria, use AVERAGEIF or AVERAGEIFS.

For the detailed step-by-step formula examples, check out the following tutorials:

#### Example 2. IF with ISNUMBER and ISTEXT functions

You already know a way to spot blank and non-blank cells using the ISBLANK function. Microsoft Excel provides analogous functions to identify text and numeric values - ISTEXT and ISNUMBER, respectively.

Here's is example of the nested Excel IF function that returns "Text" if cell B1 contains any text value, "Number" if B1 contains a numeric value, and "Blank" if B1 is empty.

`=IF(ISTEXT(B1), "Text", IF(ISNUMBER(B1), "Number", IF(ISBLANK(B1), "Blank", "")))`

Note. Please pay attention that the above formula displays "Number" for numeric values and dates. This is because Microsoft Excel stores dates as numbers, starting from January 1, 1900, which equates to 1.

#### Example 3. Using the result returned by IF in another Excel function

Sometimes, you can achieve the desired result by embedding the IF statement in some other Excel function, rather than using another function in a logical test.

Here's another way how you can use the CONCATINATE and IF functions together:

`=CONCATENATE("You performed ", IF(C1>5,"fantastic!", "well"))`

I believe you hardly need any explanation of what the formula does, especially looking at the screenshot below:

## IF function vs. IFERROR and IFNA

Both of the functions, IFERROR and IFNA, are used to trap errors in Excel formulas and replace them with another calculation, predefined value or text message. In earlier Excel versions, you can use the IF ISERROR and IF ISNA combinations instead.

The difference is that IFERROR and ISERROR handle all possible Excel errors, including #VALUE!, #N/A, #NAME?, #REF!, #NUM!, #DIV/0!, and #NULL!. While IFNA and ISNA specialize solely in #N/A errors.

Here is the simplest example of the IFERROR formula:

`=IFERROR(B2/C2, "Sorry, an error has occurred")`

As you see in the screenshot above, column D displays the quotient of the division of a value in column B by a value in column C. You can also see two error messages in cells D2 and D5 because everyone knows that you cannot divide a number by zero.

In some cases, however, you may not want to trap all errors, but rather test the condition causing a specific error. For example, to replace a divide by zero error with your own message, use the following IF formula:

`=IF(C2=0, "Sorry, an error has occurred", B2/C2)`

And that's all I have to say about using the IF function in Excel. I thank you for reading and hope to see you on our blog next week!

-->

### 2,110 Responses to "Excel IF statement with multiple AND/OR conditions, nested IF formulas, and more"

1. Mike L says:

I am trying to find a way to make this all work so that it will give me the new value.

if value is between 0 and 3999 multiply by 3% if value is between 4000 and 5999 then multiply by 10% if value is grater than 6000 multiply by 14%

• Lee C says:

=IF(AND(A1>=0,A1=4000,A15999,A1*0.14,"")))
Swap A1 for the cell which contains the value you wish to multiple.

• Lee C says:

"=IF(AND(A1>=0,A1=4000,A15999,A1*0.14,"")))"
The first formula didn't post correctly

2. rajan says:

which formula we can use if our value is 30 then multiply by 2, if 31-60 then multiply 4 and if value is grater than 60 then multiply by 5

3. Sarah says:

Hi,

I am trying to use the IF,AND function to calculate what tariff should be applied.
Three types of rates: Standard, Out of Hours and Bank Holiday
Three Type of Van: Small, Transit LWB
I have tried the following: =IF(AND(C4="Standard",C5="Small),£23,IF(AND(C4="Standard",C5="Transit", £25.....
OOH = Standard x 1.5
BH = Standard x 2

Any ideas

4. SANTOSH says:

1000 TO 2000=50
2001 TO 2500=60
2501 TO 3000=70 PLEASE CONVERT TO EXCEL FORMULA

5. Prashanth N B says:

Hi,

I have both "number" and "text" in the same cell. Like "A123". In such case comment should reflect as "Invoice received". Please help

Regards,
Prashanth N B

6. Jaques Strydom says:

Good day

Can you Please be so kind as to help me out
I am trying to do a formula where if I enter a number from 1-10 each number will represent a differt total in another cell

1=25
2=38
3=47
4=63
5=71
6=82
and so on, This is not the correct numbers.
How would I Formulate say if I put 1 in CELL A1 then the Total that represents 1 Should apear in CELL C3 for instance?

7. Imee says:

Hi,
I need a formula for my report. I need to get the result for the trace level column. If Clearing has number, result should be "Cleared" in Trace Level Column. But if Clearing column has no number, and Aging column is Over 120Days, Trace Level should be Trace 5. Below is the sample. Hope you can help me with this.
Clearing Aging Trace Level
1123456 Over 120 Days
5846821 91-120 Days
31-61 Days
5846821 1-30 Days
0 Day

8. Gene Pepee says:

I'm trying to construct a spreadsheet that has an input of several measurements, and M or F and based upon that calculates a value. But I'm can figure it out.
=IF(U2="M",359.34+0.265*(R2*S2*T2), (U2="F",296.4+0.275*(R2*S2*T2)
Thank you

9. Kristi says:

Good Evening,
I am hoping that you could help me with understanding what formula to use. I am very new to excel so this is probably pretty easy. But i would greatly appreciate if you could assist. Thank you!

Two columns of numbers (Column A and B). I need to add up the sum of the numbers in column B, however, if the number in Column B is greater than the corresponding number in Column A, it needs to count column A's number for that line instead.

example:
A B looking for sum
725 454 = 454+65+1+4+"15"+8+"5", etc.
86 65
45 1
45 4
15 45
45 8
5 31
45 28
41 1
4 84
5 45
123 8
456 52
45 8
15 5
78 8
45 4
7 8
96 45
13 7
79 84
7456 87
4 5
8789 754
76 8
78 4
76 8
4 48
89789 1
45 82
8
978 8
5 74
8 8
78 4
8 8
7 45
7 48

10. Samnan Ali says:

Hi: Svetlana Cheusheva (Ablebits.com Team)
i am marking participants Hours: as =IF(C3>=1,"Present","Absent")

I want it to show no value if the cell (C3) is empty or has no value instead of "Absent"
whatsapp +92-345-6165677

11. macky says:

Hi, I want to check if the 2 values i have in tab 1 has also in tab 2. example, in column A I have numbers.. 1, 2, 3 ……, in column B i have letters A, B, C ……….. I want to check if I have the same digits in other tab, eg. 1A, 2A, 3A etc... thank you.

12. VIJAY SUTHAR says:

=IF((Z18-AA18-AB18)>(AC14-AC11),(AC14-AC11),(Z18-AA18-AB18))
But I want Answer In positive
*Minimum Answer is Zero Not less Then Zero
So Can you Help?

13. Shane Tuttle says:

Help! Can I change all instances of say, "October", in column I, to "November", only if column B says Traffic Stops?

14. lax says:

How will you explain =IF(DAY(H18)=1;H18;"")
Formula .. We have an excel kalendar that needs to be revised for leap year

15. TJ says:

How do I create a formula that returns a projected date value based on more than one other set of data? Example: current formula is =IF(G5"",G5+60,""), but I want to include in this if another cell is YES, then the formula changes to G5+65.

16. van dwayne says:

great explanation.

17. sagar says:

=IF(And(Sheet1!F30>0,Sheet1!F30<=1)),1,0) is it correct

18. kzaky says:

=IF(IF(\$AI278>0,(IF(MONTH(AO\$21)MONTH(\$AI278),0)))),\$AF278),IF(MONTH(\$J278)>MONTH(AO\$21),0,IF(MONTH(\$J278)<=MONTH(AO\$21),\$AF278)))

this FORMULA show FALSE I NEED TO SHOW 0
WHAT IS MISSING

19. Rajesh Dahiya says:

Sir.,
I want to find a formula for gradeing
Using 4 subject marks and total ‰age
For example
Sub1=30
Sub2=85
Sub=80
Sub4=85
Now %age is 70
If we use IF function it show "A" grading
But fail in sub 1
So i want to show in result FAIL
PLZ

20. Ared says:

I am in need of a formula that would allow for the following in one cell:

If field 1=A, and field 2=I, then field 3=Low, or, If field 1=A, and field 2=II, then field 3=Low, or, If field 1=A, and field 2=III, then field 3=Low, or, If field 1=A, and field 2=IV, then field 3=Moderate, or, If field 1=A, and field 2=V, then field 3=High

My issue is there are 5 data possibilities. How do I write that in a formula?

I II III IV V
A Low Low Low Moderate High
B Low Low Moderate High Unacceptable
C Low Moderate Moderate High Unacceptable
D Low Moderate High High Unacceptable
E Moderate Moderate High Unacceptable Unacceptable

21. Bishwajit Choudhary says:

Can I use excel to start the second operation only after completion of the first. Also note, the operations are in test form and not numbers.

22. DG says:

Hello Community!
Would really appreciate if someone can help.
My case is:
I have 3 columns of varying data points.
I need to scan through the first two columns - and if both rows of data match - I need to run a secondary function where I say compare the values of the 3rd column - and give me the largest number.

Example (not necessarily what I am attempting to do):
Column A contains all First Names
Column B contains all Last Names
Column C contains all ages

I need to find every instance of "John" (column A) "Smith" (column B) and then return me the "oldest" age (column C).

Thank you everyone for your help! Greatly appreciated.

IF(A1>0 THEN A1/B1,A1/C1,A1/D1)
RESULT SHOULD SHOW FIRST DEVIDING RESULT AND IF FISRT DEVIDING RESULT BE 0 THEN SHOULD SHOW SECOND DEVIDING RESULT IF SECOND DEVIDING RESULT BE
ALSO 0 THEN SHOULD SLOW THIRD DEVIDING RESULT.
HOW CAN I MEET FOLLOWING CONDITION IN A SINGLE CELL

24. Sarah says:

I need a formula to fill a cell with text (5 possible text outcomes).
I need several cells to be checked to decide which of the text options are filled, (5 different cells to check).
eg, if cell b=No fill with 'text a', if = yes check cell c, if c = no fill with 'text b', if = yes check cell d and so on.

25. new GM says:

=IF((\$D2="legendary",RANDBETWEEN(500001,1000000),IF(\$d2="veryrare",RANDBETWEEN(5001,50000),IF(\$d2="rare",RANDBETWEEN(501,5000),IF(\$d2="uncommon",RANDBETWEEN(101,500))))))

I am trying to make a shop pricing algorithm for my D&D campaign that will generate random prices based off of item rarity. so far I have a list of about 500 items each assigned a rarity uncommon, rare, veryrare, and legendary, in the D column. I am using column F to generate the costs for each item using the formula above. anyone have any ideas why this is creating an error and how to fix it?

26. Manju says:

Hi,
I want to compare vales in two cells and assign a value in 3rd column with multiple conditions, e.g.,
If (I4="H" & K4="H") OR (I4="M" & K4="H") OR (I4="H" & K4="M"), assign number 1 to L4
OR
If (I4="M" & K4="M") OR ( I4="M" & K4="L") OR (I4="L" & K4="M"), OR (I4="L" & K4="H"), OR (I4="H" & K4="L), assign number 2 to L4
OR
If (I4="L" & K4="L"), assign number 3 to L4.
Thanks.
Humbly,
manju

27. Dave says:

I'm trying to write an logical statement to do the following:
Assume the statement is in Range Name "Question"
If Value in Range Name Value = 3
Then Question = Value
and
Range Name Result = Value
The first part is ease [If(Value=3,Value)]
But if I try [IF(Value=3,AND(Value, Result=Value)] it doesn't work.
Is there a way to set value in a named range from a statement in a cell/range not where the value should go?

Thanks

28. Jason East says:

Hi,
if b2 equals 1 I need the calculation to = 4 and if b2 is 2 then I need the calculation to = 8

29. Declan says:

Hi,
I have a number of figure ranges that have corresponding different values. What is the formula to automatically calculate the value applicable when given a figure within one of the ranges?

Ranges and their corresponding values are:
0.005 - 0.025 = 5
0.025 - 0.05 = 7.2
0.05 - 0.1 = 16.3

Thanks.

30. Katie says:

Hi,
I need a formula IF value in J8 is less than 0 add J8 & G9, IF more than 0 add J8 & C9.

31. Siddu says:

Hi need formula below mentioned
i want result 1 2 3 45
80% 90%
91% 99%
100% 110%
111% 120%
>120

32. Siddu says:

Hi
80% -90% 1
91% -99% 2
100%-110% 3
111%-120% 4
>120 5

33. Steve says:

How to make formula. If Cell4 = Cell1, but if Cell2 has data then Cell4 = Cell2, like wise if Cell3 has data then Cell4 = Cell3. So in short Cell 2 and 1 will not be shown or be read if the Cell3 has data. More likely an updating formula. Please help Thanks

34. Abhay says:

I want to write a simple Conditional format rule -

If column H contains either texts - VTA or ADI or SBI , value in column P should be a difference of (Value in Column O - Value in Column G)

• Hi Abhay,

Here goes the formula for P2:

Just copy it down to as many cells needed.

35. Neel says:

whats the formula if i want to calculate the total QTY that has a value only. Currently i have qty with number but no value, so i want to only count qty with actual value

36. Saman De Silva says:

How can i write - (minus values in nested if functions

37. Asghar Abbas says:

Pls guide I’ve 2 vehicles (Vehicle 1 & 2) in Column C, both mileages in column E should multiply by different values and need answers in column F. Please advise the formula?

38. Alex Lord says:

Need help with creating a formula based off this statement,
If Gross profit <= 15,000, then taxes = Gross profit X 20%, Otherwsie taxes + Gross Profit x 39%
the cells i am currently using is Gross profit is G12 and my Taxes cell is B24
Thanks

39. Steve Cooper says:

hello, i am trying to get a if statement to work, here is my scenario:
IF(COUNTIF(Data!J:J,"R")>=50%,"R",IF(COUNTIF(Data!J:J,"A")>=70%<95%,"A","G"))
i have a list of R/A/G entries that get updated regularly, so the count will always change, i am trying to say if the "R" count is greater than 50%, but lower than 70% give an "R", if the count is between 70% and 94% Return an "A" and if the Count is greater than 94% than return a "G", these counts are based on the total amount of rows that are populated.
i also need to have another formula that states that if they are all under 50%, sort of like 33%R, 35%A and 32%G, to return the highest amount, with the numbers presented it would be "A". i have found this challenging to figure out and hope someone there can help

thank you

40. Mate says:

Can someone please help, if is score in 6 boxes 60 or more to add additional 30 on final result but if is 59 and below to have exact score. Thanks

41. Kaja says:

I want a function in if
In electricity bill payment come under like this
0 to 60 units = 10 \$ per each unit
60 to 100 units = 20 \$ per each unit
over 100 units = 30\$ per each unit
Example
We use 120 units so calculation come like this = (60 x 10) + (100-60)*20 + (120-100)*30
Can you give the excel formula to that

42. Mem says:

I'm trying to assign a formula in cell A3 to display the performance rating in text form in that cell (A3) for an employee when there are 3 different tasks that an employee can work at different times (letter code for the type of task will be entered in cell A1). Each task has it's own performance ranges with different target range, above target range, exceeds range, and below target range for each task. The employees actual performance number goes in cell A2.
So let's say the 3 different tasks that can be selected for an employee in cell A1 are:
1. Calling (or "C"),
2. Escalation (or "E"), and
3. Research ("R").
The performance rating ranges for Calling ("C") are
Below Target (or "B") is =21 but =31 but =41
The performance rating ranges for Escalation ("E") are
Below Target (or "B") is =16 but =26 but =36
The performance rating ranges for Research ("R") are
Below Target (or "B") is =31 but =41 but =51
If I enter the type of task in cell A1 that the employee worked (it can be either "C", "E", or "R"), and in cell A2 I then enter the employee's actual performance result number for that specific task, I need cell A3 to display the letter rating that corresponds to that performance result (of either "B" if that performance falls below target, "T" if it falls in the target range, "A" if it falls in the above target range, or "E" if it falls in the exceeds performance rating range) for that specific task.

The formula I tried to enter in cell A3 (and have tried tweaking multiple times) but isn't working is this one:
=IF(AND(A1="C", A2=21,A2=31,A2=41), "E", IF(AND(A1="E", A2=16,A2=26,A2=36), "E", IF(AND(A1="R", A2=31,A2=41,A2=51), "E", ""))))
I've gotten the message that I don't have enough opening or closing parenthesis, so I'll play around with the number of parenthesis until I stop getting that message but then I get an error message saying I have too many arguments. If I try to use variations with IF, AND, OR together it only works for the 1st 2 conditions and then just gives a "FALSE" in the cell if the 1st 2 conditions aren't met.

Can you help me fix the formula or help me with a new one please? Many thanks.

• Shie says:

I think the problem is the reference output "E".

43. Mem says:

Apologies for the re-post, but since it appears that my greater than or equal to and less than or equal signs are getting omitted or translated into something else, I'm going to spell out the "greater than or equal to" and less than or equal to" to try and show it correctly.
Please see corrected performance ranges further below for each task (Note: in cell A1 I will input either a C, E, or R to show the type of task for that employee. In cell A2 I will input the actual performance number score that the employee had for that month, and then I need the formula in cell A3 to display the corresponding letter performance rating based on the employee's number performance score for the specific task selected in cell A1).

I'm trying to assign a formula in cell A3 to display the performance rating in text form in that cell (A3) for an employee when there are 3 different tasks that an employee can work at different times (letter code for the type of task will be entered in cell A1). Each task has it's own performance ranges with different target range, above target range, exceeds range, and below target range for each task. The employees actual performance number goes in cell A2.
So let's say the 3 different tasks that can be selected for an employee in cell A1 are:
1. Calling (or "C"),
2. Escalation (or "E"), and
3. Research ("R").
The performance rating ranges for Calling ("C") are:
Below Target (or "B") is less than or equal to 20,
Target (or "T") is greater than or equal to 21 and less than or equal to 30,
Above Target (or "A") is greater than or equal to 31 and less than or equal to 40,
Exceeds (or "E") is greater than or equal to 41

The performance rating ranges for Escalation ("E") are:
Below Target (or "B") is less than or equal to 15,
Target (or "T") is greater than or equal to 16 and less than or equal to 25,
Above Target (or "A") is greater than or equal to 26 and less than or equal to 35,
Exceeds (or "E") is greater than or equal to 36

The performance rating ranges for Research ("R") are:
Below Target (or "B") is less than or equal to 30,
Target (or T") is greater than or equal to 31 and less than or equal to 40,
Above Target (or "A") is greater than or equal to 41 and less than or equal to 50,
Exceeds (or "E") is greater than 51

If I enter the type of task in cell A1 that the employee worked (it can be either "C", "E", or "R"), and in cell A2 I then enter the employee's actual performance result number for that specific task, I need cell A3 to display the letter rating that corresponds to the performance result for that task based on the above performance ranges (of either "B" if that performance falls below target, "T" if it falls in the target range, "A" if it falls in the above target range, or "E" if it falls in the exceeds performance rating range) for that specific task.

The formula I tried to enter in cell A3 (and have tried tweaking multiple times) but isn't working is this one:
=IF(AND(A1="C", A2 is less than or equal to 20), "B", IF(AND(A1="C", IF(AND(A2 is greater than or equal to 21, less than or equal to 30)), "T", IF(AND(A1="C", IF(AND(A2 is greater than or equal to 31, less than or equal to 40)), "A", IF(AND(A1="C",A2 is greater than or equal to 41), "E", IF(AND(A1="E", A2 is less than or equal to 15), "B", IF(AND(A1="E", IF(AND(A2 is greater than or equal to 16, less than or equal to 25)), "T", IF(AND(A1="E", IF(AND(A2 is greater than or equal to 26, less than or equal to 35)), "A", IF(AND(A1="E",A2 is greater than or equal to 36), "E", IF(AND(A1="R", A2 is less than or equal to 30), "B", IF(AND(A1="R", IF(AND(A2 is greater than or equal to 31, less than or equal to 40)), "T", IF(AND(A1="R", IF(AND(A2 is greater than or equal to 41, less than or equal to 50)), "A", IF(AND(A1="R",A2 is greater than or equal to 51), "E", ""))))

I've gotten the message that I don't have enough opening or closing parenthesis, so I'll play around with the number of parenthesis until I stop getting that message but then I get an error message saying I have too many arguments. If I try to use variations with IF, AND, OR together it only works for the 1st 2 conditions and then just gives a "FALSE" in the cell if the 1st 2 conditions aren't met.

Can you help me fix the formula or help me with a new one please? Many thanks.

44. Matt says:

Hi,
So I'm trying to create a holiday& absence record that runs from MAY 2020 to the end of APRIL 2021.

What I want to do is if they take a full holiday off I put a "1" on that day and it'll count at the end of the row in the total days taken column. What I also want to add is half days, so I want to be able to enter "AM" & "PM" and each to count 0.5. So for example, if someone took 3.5 days off in that month the columns in the row for that person may look like: 1 1 PM AM AM or 1 1 1 PM

Or is it possible to have a formula in another column that would add up "AM" as a value of 0.5?

Kind Regards

45. Chandre Erasmus says:

Hi There,

I have a bit of a challenging problem to solve.
I have different salaries on different occupational levels and need to identify the minimum and maximum salaries for each level. All my data is on one sheet, will it be necessary to split the occupational levels with their salary data on separate sheets first? For example:

Employee 1: Top Management R 50 000

Employee 2: Senior Management: R 30 000

Employee 3: Middle Management: R 15 000

Employee 4: Top Management: R 20 000

It's too much data to sort, any suggestions?

Kind Regards

I have two sheets.
Sheet 1:
A: Coke
B: 2L
C: formula???

Sheet 2:
A: Coke
B: 2L
C: R23

In sheet one if i type in coke in column A and 2L in column B it should give me the amount for a 2L in column C.

I have different prices for example
2L
500ml
440ml

47. Julia says:

Hi,
I am looking for a formula to satisfy the following condition:
IF cell A1 = Y, then multiple A12*J12, but if cell A1 = N, then state 0 as a number

Thank you,
Julia

• Portia M says:

=IF(A1="Y",A12*J12,IF(A1="N",0))

48. Mohd Khaleque says:

if calculated figures comes 21 then it should come 20 and if calculated figures comes in between 21.1 to 30 it should come 30 in one excel formula

49. Anna says:

I am trying to find a way to make this all work so that it will give me the new value of bonuses to give sales rep
if value (A1) is between 100 and 149 add \$40 if value (A1) is between 150 AND 199 Add \$70 and if value (A1) Is greater than 200+ add \$100.

• Amy says:

Hi Anna, I have a similar formula question, did you ever find anything out?

• Portia M says:

Have you tried this?
=IFS(A1>100,A1+40,A1>150,A1+70,A1>200,A1+100)

50. Ramdas Ajith says:

Thank you so much for looking into this.
I have a list of 10 items and I would like to get a particular item from the list incase the validation that iam inputting turns out to be True.

51. Asher says:

Hi,
I am trying to make a cell display a specific value dependent of the values selected in two drop boxes in separate cells
Example:
B2 has a drop down box currently showing a value of 4
C2 has a drop down box currently showing a value of 4 Ω
I want D2 to show a value of 3240
When i change the value in dropbox B2 to 8 Ω. I want the value of D2 to now show 2112

52. sanjeev says:

Hi
ex: there are three columns A,B and C.A&B columns has numbers like 20,30 now my requirment is the value of column should be "which ever is lower"of A&B.Kindly help me to get the same.
thanks

I want to look at two cells(K69 & K70) and give results(in K72) based on what is in them.
so if either cell K69 or K70 are blank then cell K72 should show a blank cell
if cell K69 & K70 have data then a question to be asked for each cell (K69<.91 & K70<.91) if they are K72 show pass if not then K72 shows Fail

I have a start, just do not know have to get K72 to show blank if one of K69 & K70 is blank with no data in them.

=IF((AND(K69<0.91,K70<0.91)),"PASS","REJECT")

54. Amy says:

HELP!
I am needing an IF formula to help calculate hours/paid and hourly bonuses
For example...
total shop hours = ##
IF they are in-between the following there is a bonus based on the number of shop hours
80-89.9 - \$1.00
90-99.9 - \$2.00
100+ - \$3.00

TIA

55. anonymous says:

56. JOSH says:

HOW CAN I MAKE IT IN 1 FORMULA?
SAL, AGRIL AND AL-SP = 20
SHL, SOL, LC, EMERL, CAL, APL, ABPL, LR, IL, AND RDL = 12
QL=16
HSL=19
PVL=21
BSL AND KSNL = 22
RTL = 28
EDUCL = 60

57. Hikmat says:

How can i make a score sheet, if a student have fail 2 subjects in 10 subjects, show
SECOND CHANCE, if a student have fail 3 subjects in 10 subjects, show FAIL RESULT.
Note: all subjects must be 10.

58. Jamie says:

I am not sure of the function to use, or how to write this. But I want
Cell S2 to equal:
IF Cell I2 = 3 then add Cell P2, Q2 and R2 and insert the answer or If Cell I2 = 2 then add Cell P2 & Q2 and insert the answer, or if Cell I2 =1 then = R2. If I2 is blank or = 0 then S2 should equal 0.
I want S2 to look at I2 and see if it is a 3, 2, 1, 0 or blank and depending on the value then it needs to add certain cells to get the answer. Can you help me?

59. Karthi says:

Hi,
Among four cells, if one has value (Specific text) fifth cell should be "yes". How to create formula for this? Pls help me

60. Lorrie says:

I am trying to get a cell to be "conditional" ie. if the contents of one cell states a certain criteria (Like if it contains "J1555 or J1569, or J1575") then it needs to take the amount entered into another cell and multiply it by 10. I had came up with:
IF=(F41=J155, J1569, J1575), H41/10). This is not coming up with what I need. Please help. The J-codes listed are actual codes that I use on a daily basis and have to do calculations manually for. Would LOVE to have excel do it for me.

61. Portia M says:

I'm not an expert in excel, but i think this could work
IF((OR(F41=J155,F41=J1569,F41=J1575)),H41*10,"")

62. Cristina says:

Hello!

When i'm using this formula:
{=IF(AND(Pontaj!M9:V9="CFS";SUM(Pontaj!M9:V9)=0); "CFS"; IF(AND(Pontaj!M9:V9="CO"; SUM(Pontaj!M9:V9)=0); "CO";IF(AND(Pontaj!M9:V9="LP"; SUM(Pontaj!M9:V9)=0);"LP";IF(AND(Pontaj!M9:V9="N"; SUM(Pontaj!M9:V9)=0);"N";IF(AND(Pontaj!M9:V9="L";SUM(Pontaj!M9:V9)=0);"L"; IF(AND(Pontaj!M9:V9="CM"; SUM(Pontaj!M9:V9)=0);"CM"; SUM(Pontaj!M9:V9)))))))} when the result it should be "CFS" or "CO" or "lp" etc., i get the result 0. What should i do to get the result "CFS"?
Thank you!

63. AR says:

Can you change it to "you performed well" instead of "you performed good?"

• Done, thank you!

64. Ravi Krishnan says:

How do I nest multiple IF statements + AND in this case.
Columns C1 = 2000; C2=1500; C3=2000
Row H1 = 1250; H2=3000; H3=1400;
Row S1=1; T1=0; U1=1; V1=1; W=0
Formula I am trying to fill Row AA1 BB1 CC1
AA1- I want this cell to be filled with 0 if S1=1 and H1C1 as well as S1=0 and H1<C1.
I want the cell to be filled with 0 ONLY for S1=1 and H1<C1. If S1=0, I don't need to check for H1<C1. We can by-pass and fill the cell with text "NF". Please help me out on this.

65. moqeemkhan says:

=IF((AND(AW8<0,AY8(AZ8*AW8)-AY8)))

66. Sp says:

hi
i need 6 contion in same cell

67. Mohamed Gouse says:

HI, I could really use some help making an if/then equation:
-If A2:F2 equals 0, then "1"
-If A2 > 1, and B2:F2 1, and C2:F2 1,then "3"
-If C2 > 1, and D2:F2 1,then "4"
-If D2 > 1, and E2:F2 1,then "5"
-If E2 > 1, and F2 1,then "6"
-If A2:E2 > 1, and F2 > 1, then "7"
Thanks!

68. DeepG says:

Dear Expert,
I have to use a formula for retrieving the value based on multiple cells, I have tried multiple options using IF, AND but I cant achieve the results.
Let me try to add the query to explain (only few examples) however this has to be replicated until last line.
I already tried different formula as below but I can achieve the result maximum upto 2 values, not nested upto last lines.
=IF(IF((AND(H5>=2,I5>=4)),"V2","V1"),(IF((AND(H5>=4,I5>=8)),"V3","V2")))
=IF(OR(AND(I5>6),AND(H5>=2,I5>=4),AND(H5>=4,I5>=8)),"V3","V1")
- if Value in the "vC" cell is 2 and value in "Me" cell is 4 then category should come as "V2"
- if Value in the "Me" cell is more than "6" because that is maximum limit then category should come as "V2"
- if Value in the "vC" cell is 4 and value in "Me" cell is 8 then category should come as "V3"
Default Size Max size
Category vC Me vC Me
V1 1 2 2 6
V2 2 4 4 20
V3 4 8 8 40
V4 8 16 16 32
V5 16 32 32 96
V6 16 64 16 192
V7 32 128 64 128
V8 64 128 64 384
V9 64 256 64 256

69. sowmi says:

the values has to be in specification, if it is entered between the specification values have to accepted by column. If values are exceeded or lowered it would be "0" or highlighted. How to do this in excel by using VLOOKUP or IF CONDITION? eg;spec: 50-80 if I enter 65 it has to be the same, if I enter 81 it has to be noted by excel

70. George says:

I am trying to use the IF Function (or any formula) to SUM for a particular date depending on if the date also has the exact name attached to it. For instance, I want a cell to calculate how many hours a person "John Doe" participated on a seperate sheet for a calendar month to populate on a calendar on a seperate sheet. It is only dependant upon the date and name, nothing else. How do I do this?

71. Hazeez-ur-Rehman says:

I have one doubt
I am making result I wanted to do if a student fails in 1 subject then excel shows supply if he fails in 2 subjects then excel shows 2 supply but if he fail in 3 or more than 3 subjects then excel shows it Fails Whats the formula I can apply?

72. Ahkam jaffri says:

It’s hard to come by experienced people about this subject, but you seem like you know what you’re talking about, keeping the good work up! Thanks

73. Nik says:

Test - 1 Marks - 70
Test - 2 Marks - 65
Test - 3 Marks - 78
if a student gets more than 70 in any two tests from the above then he/she will get A otherwise F. Then what will be the formula??

• Hi Nik,

=IF(COUNTIF(A2:C2, ">70")>=2, "A", "F")

Where A2:C2 are the test marks.

74. Israr says:

Hello Folks,
Kindly advise how to do this excel formula correctly.
Cell B1 has Data Validated with list of (A,B,C,D)
Cell E5 has a number to be multiplied with
Cell F5 has formula i.e. =IF(B1<=A,(E5*0),IF(B1<=B,(E5*7),IF(B1<=C,(E5*21),IF(B1<=D,(F5*30),(E5*21)))))

75. Mudassir says:

Respected,
I hope you are doing well. I have stuck in a problem and I hope you will solve my this issue.
I have a sheet of employees of an organization which include their salary designation etc. I have to search a designation which give me the full details of all employees (at the same position) .
I hope you have understood what I want to ask

76. Christina Cann says:

Hi,
I am looking for a formula which will autopopulate value of "Primary" if the time start is 8:00 to 17:00 and 'Non-Primary' if the value is set to the other part of the clock, primarily 17:00-24:00 and 0:00 to 8:00.
Any pointers would be awesome!
Christina

• Hi Christina,
Please try to apply the following formula:

=IF(AND(HOUR(A1) >= 8,HOUR(A1) <= 17), "Primary", "Non-Primary")

Where A1 is the cell that contains the time.

77. steve g says:

i am looking for a formula where a letter appears in A11, (A to E)
depending what that letter is determines which cell i want data for.
-If A11 equals "A", then A41
-If A11 equals "B", then A42
-If A11 equals "C", then A43
-If A11 equals "D", then A44
-If A11 equals "E", then A45

whats the best way to do multiple arguments for the data?

• Hello Steve,
It looks like the following formula will do the trick:

=IF(A11 = "A", A41, IF(A11 = "B", A42, IF(A11 = "C", A43, IF(A11 = "D", A44, A45))))

78. Abdul Mustaan says:

S.No Name F Name Eng Maths Science Social Total % Rank Grade
1 Sam David 84 85 85 85 339 84.75 Pass A
2 Frank Joseph 100 60 50 80 290 72.50 Pass A
3 Mark Tom 99 42 85 40 266 66.50 Pass B
4 Dave Smith 40 42 40 40 162 40.50 Pass C
5 Jhon Gill 40 25 40 40 145 36.25 Fail Blank Cell Required
Question:I want to put in this cell with Vlookup formula a new formula with above formula for If Pass Show Grade If Fail Don’t Show any thing (Blank)
using =VLOOKUP(G6;K\$1:L\$5;2)

79. Abdul Mustaan says:

My Mean If any one subject get below 40 marks get fail and dont show any thing in cell, if get good marks show A-1, A, B, grades.

80. Crystal says:

Is there a formula for:

If Column A contains the letters "REQ" and column B contains the word "Accepted", then column C shows "Status w/ Acceptance"?

And if Column A does not contain the letters "REQ" and column B does not contain the word "Accepted", then column C shows "Status w/out Acceptance".

Thanks!

• Hi Crystal,
Here is the formula for you:

=IF(IFERROR(FIND("REQ", A1, 1)*FIND("Accepted", B1, 1), 0) > 0, "Status w/ Acceptance", "Status w/out Acceptance")

81. Mark Goosen says:

Hi guys,
Need help, basically I need to add 15% to a cell value based on the value of another cell. its to do with weight, so for every 1000 "pounds/kilograms", I need to add 15% to the fuel consumption.
=IF(AND(B16>=1000),B5*15/100,IF(AND(B16>=2000),B5*30/100))
This is the formula I have, any advise/support/help will be greatly appreciated. happy to share the sheet if that will help

• Hi Mark,

=ROUNDDOWN(B16/1000, 0) * 15/100 * B5+B5

Hi,
I would liek to come up with a formula to calculate the completion rate of an action plan,I have 3 dates : Date whan the action added to the list, the target date(due date) and the completion date.
If the completion date is empty(action not completed) and the target date inferior of the today's date the result is 100%
If the completion date inferior or equal to target date the result is 100%.
If the completion date superior to target date the result is (completion date- target date) / (Completion date-date added).
Thanks

83. Carlyn says:

Hi

I'm working on a points generating spreadsheet for a dance school...
I need to know the best formula to use if I have a "key" of points (eg. straight final = 0 bonus points, semi final = 1 bonus point, quarter final = 2 bonus points etc.)
Eg CELL C2 = QUATER so D2 should = 2.... but the administrator should only have to fill in the rounds danced (C2) - D2 should be a calculation.

Thank you
Carlyn

84. Dave Jones says:

Is there a way to write a formula with multiple IF AND functions that will go to a VLOOKUP? I need to match a table with up to 20 entries up with two different criteria, i.e. "IF condition 1 is A, AND condition 2 is C, then VLOOKUP table E. IF condition 1 is B, AND condition 2 is C, then VLOOKUP table F".

85. Marlon says:

PLEASE HELP CHECKING THE VALUE of another sheet those have "1JR" text value and with the lower age value 5 and below.. if satifies both cell value then will get the particular cells surname or firstname of that person in the sheet.
sample but not working..the formula below
=IF('Competition Entry'!D4 ="1JR",'Competition Entry'!F4<=5,'Competition Entry'!C4)

86. kassahun says:

How I calculate using the condition of 25% of old salary ,if qualification is MA and sex Female, 15% of old salary ,if qualification is BA or BSC, 17% of old salary ,if qualification is MA or MSC and 20% of old salary, otherwise

• Hello Kassahun,

=IF(AND(C2="Female", B2="MA"), 25%, IF(OR(B2="BA", B2="BSC"), 15%, IF(OR(B2="MA", B2="MSC"), 17%, 20%)))

Just copy this formula down the column if necessary.

87. Santhosh says:

if type a text in A1 cell "A", in A2 cell the value i want is "0" so what formula should i use , please help

88. Brian says:

Hi,
IF C1="Personal" is there a way to get excel to display certain rows? so if C1="Personal" rows B3:B6 will display.

Thanks

89. santosh says:

Hi...

one of the excell cell showing text like"Direct Billing - 35% of deal value" but in formula bar same cell is showing only "35%". how is it possible

90. jrv says:

I am trying to put together the following functionality but have no idea where to start. Is there a way to tie all this functionality together to produce a result in one cell based on the following criteria?

IF B2 & C2>0 then AD2*.01
IF B2 & D2>0 then AD2*.01
IF C2 & D2>0 then AD2*.005
IF B2 & C2 & D2>0 then AD2*.0125

91. Jerome says:

Can someone help me with a formula to show if learner has passed or failed a Grade, whereby to pass a learner has to meet the following subject requirements
Home Language >= 50%
Any other 3 subjects >=40%
Any other 2 subjects >=30%
Thanks

92. Anish says:

How I make if condition aganist below article.

A1 row have some time appear data.[A1 row is also set formula{=}].
Above mentioned formation as showing A1 data.(TP-66-67-U144-114-WF-A5R-0003).

When data appear in A1 row then I want to show 3rd row(A3) will appear "C".A1 haven't data then A3 is also doesn't appear data.

93. Anish says:

How I make if condition aganist below article.

A2 row have some time appear data.[A2 row is also set formula{=}].
Above mentioned formation as showing A2 Row.(60-62-2038-11011K-N).

When data appear in A2 row then I want to show 1st row(A1) will appear "Line list".A2 haven't data then A1 is also doesn't appear data.

94. Shawn S says:

I'm trying to make a formula so that one cell reads 10, 5 or 0 depending on what's in the cell before it. However, the cell before it would have text or phrases that determine the 10, 5 or 0 score. Here is what I have so far:
=IF(B13="Gravel","10",IF(B13="Grass","5","0"))
In addition to Gravel=10, I'd like Bare Soil, Fallow Land, and Poor Farm to also equal 10. How can I add these phrases?

95. LORWIL says:

i HAVE THIS WORKING BUT RETURNS #VALUE! IF AP2 IS BLANK
=IF(AND(AP2>0,C2="DIRECTOR"),SUM(AS2*0.035)/12*AP2,SUM(AS2*0.0575)/12*AP2)
i WANT IT TO ALSO RETURN BLANK IF AP2 IS BLANK - NEED HELP

96. Bácskai Zsolt says:

good tips, but pls. note that this is wrong: "=IF((AND(C2>=20, D2>=30))"
it works only with ; instead of , like this: =IF((AND(C2>=20;D2>=30))

• Hi Bácskai,

That depends on which List Separator is set in your Regional Settings: in North America it's the comma, in most European countries - semicolon.

97. Emma says:

Hi!
I'm trying to find a formula for a kid to practice the irregular verbs on excel, it makes me practice excel formulas too..!
I'd like to have a formula that says: if the content of 2 cells (the one with the correct answer and the one which needs to be filled out by the kid) is equal AND the next 2 others are equal too etc... (the whole line made up of 4 cells has to match the line with the correct answers). If it does, then display "correct", if not, display "Wrong".
I've tried this one but it's obviously wrong
=IF((AND("B4"=G4, "C4"="H4", "D4"="I4", "E4"="J4")), "Correct", "Wrong")

I hope this was clear enough ... Any help would be much appreciated!
Thanks,
Emma

98. Katherine says:

Hi!
In using Data Validation, I'm trying to include that text should be in UPPER case when using the formula below:
=IF(F3=''",TRUE,IF(ISERROR(SUMPRODUCT(SEARCH(MID(F3,ROW(INDIRECT("1:"&LEN(F3))),1),"0123456789abcdefghijklmnopqrstuvwxyz"))),FALSE,TRUE))

Any help would be appreciated.

99. Brenda says:

I want to do a vlookup between 2 workbooks and the if the values match then I need to output a cell value from workbook 2 into workbook 1. For example: If W1.A1=W2.A2:A1000 then populate with W2.appropriate cell value in column D. I have the vlookup working but having a hard time getting it work with the if statement and outputting the appropriate cell value.

100. Hae Lee says:

Hi! I need to show "Retained" if 3 or more failed, "Conditionally Promoted" if 1 or 2 failed and "Promoted" if no failed. I used this formula but it only shows two arguments and I'm having difficulties inserting the other argument.
=IF(COUNTIF(M25:N39,"Failed")>=3,"Retained","Promoted")