# 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 below formula will return "Divide by Zero Error" (#DIV/0!) if cell A2 is equal to 0:

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

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!

## You may also be interested in

Category: Excel Tips

### 3,253 responses to "Excel IF statement with multiple AND/OR conditions, nested IF formulas, and more"

1. Andrew says:

Hello! I need a formula to display a scholarship.

These are the conditions:

• if 8 ≤ final_grade < 9 print 300 ;

• if 9 ≤ final_grade < 9,5 print 400 ;

• if final_grade ≥ 9,5 print 600 .

of course, I have a column where final grades are placed.

I wish I was clear with my commnet... I can't wait for an answer!

Thank you, All the best!

• Andrew says:

my difficulty is to use more conditions in "IF" syntax... I don't know how to do that...

• Andrew says:

I tried to use more '' IF '' in Formula Bar ( like in Progamming for example - elseif ... ... ...) but it doesn't work and I don't think it's possible something like that.

• FATJONA says:

=IF(C6<8,"NO RECEIVE", IF(C6<9, 300,IF(C6<9.5, 400, 600)))

• Hello!

2. ABAS KHAN says:

i am using formula which is below mentioned but the result is for "yes" ok but for "#n/a" result is same #n/a but i need to show the result is "NO" which is base on formula.

example: =IF(I1="#N/A","NO","YES")

regards,
ABAS

3. Dylan M Casey says:

=TEXTJOIN("/",TRUE,IF(K2>=45,45,IF(K2=40,"35/5",IF(K2=30,"25/5",IF(K2=20,"10/10",IF(K2=15,"10/5",IF(K2=0,"",K2)))))

Could someone explain what is wrong with formula or if I'm using the wrong mechanism.

This is the error I am receiving "Wrong number of arguments to IF. Expected between 2 and 3 arguments, but got 7 arguments."

Any help is appreciated, thanks.

• Hello!

=TEXTJOIN("/",TRUE,IF(K2>=45,45,IF(K2=40,"35/5",IF(K2=30,"25/5",IF(K2=20,"10/10",IF(K2=15,"10/5",IF(K2=0,"",K2)))))))

Hope this is what you need.

4. Rajendra Swami says:

I need a formula for below conditions (urgent required):

01. if (a1 or b1 or c1 = "P", 1,0
02. (i) IF(A1:C1)="P", "THREE",0 (three cells value are "P")

(ii) IF (A1 AND B1="P" AND C1="") OR (A1 AND C1="P" AND B1="") OR (B1 AND C1="P" AND A1=""), "TWO",0
(any two cells are "P" from three cell)

(iii) IF (a1="p" and b1 or c1="") OR a1 and b1 ="" and c1="p") OR (a1 and c1="" and b1="p"), "ONE",0
(only any one cell is "P" from three cells)

• Hi!
I hope you have studied the recommendations in the tutorial above. It contains answers to all your questions.

5. Michael Solan says:

Found really useful thank you!

6. carla says:

IF B4=290,B4=2449,B4=250 C2="",C3+"", if True " Please provide this information" if False the data in E1.

7. Dena Pinkman says:

I NEED TO CREATE A FUNCTION:

=IF (IC25>IA25, "URGENT", "OK")

BUT I ALSO WANT IT TO LOOK AT COLUMN - ID IS GREATER THAN 1 THAT IT CREATES "ON PO"

• Hello!
Based on your description, it is hard to completely understand your task. However, I’ll try to guess and offer you the following formula:

=IF(ID25>1,"ON PO",IF(IC25>IA25,"URGENT","OK"))

8. Bruna says:

Hello! I'm trying to do a multiple conditional formula and I'm having trouble getting it to work...
I'm trying to make something like this:
If A is TRUE and B is TRUE, the formula should be something like AVERAGE(A;B)
If A is TRUE and B is FALSE, then it should be =A
If A is FALSE and B is TRUE, then it should be =B
If A is FALSE and B is FALSE, =0
I wanted to do it with multiple conditions, like A, B, C...
How can I make it work? I tried everything I knew.
Thanks!

• Hello!
I hope you have studied the recommendations in the tutorial above. It contains answers to your question. Use a formula like this:

=IF(AND(A1=TRUE,B1=TRUE),AVERAGE(A1:B1), IF(AND(A1=TRUE,B1=FALSE),A1, IF(AND(B1=TRUE,A1=FALSE),B1, IF(AND(A1=FALSE,B1=FALSE),0,""))))

9. Mike says:

I hope someone could help me to condition, where I can have a column where it would either say “Complete” and “Incomplete” to reflect overall completion of requirements? The value is either Yes or No. If all answered 'YES' it will show "complete" and if any "No" answered "incomplete

10. Nicholas O'Brien says:

I have used the formula =IF(P2="V13-1X-BLU-1",N2+1457), so when the cell contains the text V13-1X-BLU-1 it adds 1457 days to the date (N2 contains date). Is it possible expand the formula to recognise more text (V9-2X-BLU-1) and make different additions (+804) ?

11. Kyle says:

Hi, I notice many IF scenarios above, but none that fit my scenario where I am also using a hyperlink. Any chance you can assist with the answer? Below is an example of what I am doing. The only thing I am trying to add is when D12 & D13 = other number combinations, I want that to reference a different hyperlink (image). Is it possible to add multiple IF's and hyperlink's in a single formula?

I know this formula is wrong, but it depicts what I am trying to do with as many conditions as I need:

Thanks,
Kyle

• Hello!
If I understand your task correctly, the following formula should work for you:

12. Trisha says:

What is the formula"if function" if you are getting the valedictorian, salutatorian in a class with the basis of ranking?

13. James Hardin says:

If age is between 18 and 56 and Sex is either "M" or "F", remark is "Qualified"

• james hardin says:

what is the formula? If age is between 18 and 56 and Sex is either "M" or "F", remark is "Qualified"

• Hello!
I recommend using the recommendations of this article above. To calculate age use this guide - How to calculate age in Excel from birthday.

14. suresh says:

Related text need to display in 1st table from the 2nd table, If we write a remarks in the 2nd table following and related text in the 1st table -- can any one write the if formula for this

Hi,

I'm trying to setup an if statement needing both the and & or functions.

The OR statement is =IF(OR(Recruits="Yes",Refresh="Yes"),1,0)
The AND statement will be if Eng = Yes, and IF(OR(Recruits="Yes",Refresh="Yes")

I can get both to work individually, but not together, is this possible?

I have created a matrix to see all possible outcomes, to test (Below)

Eng Recruits Refresh
Yes Yes Yes
Yes Yes
Yes
Yes
Yes
Yes

• Hi!
Based on your description, it is hard to completely understand your task. However, I’ll try to guess and offer you the following formula:

=IF(AND(A2="Yes",OR(B2="Yes",C2="Yes")),1,0)

16. Nanita Mathew says:

I want to color a cell based on whether it is a date or not. Eg:if A1 has a date, E1 should be green otherwise, no color.
The closest I've got is using 'ISNUMBER' function. But this will color E1 even if I randomly put a number in A1.Is there anyway I can specify it to date?

• Hello!
I think that the cell in which the date is written must have a date format. Therefore, I recommend using the CELL function and checking what format the cell has.

=CELL("format",F3)

• Nanita Mathew says:

I got it.. thank you😊

17. Tatyanah says:

hello I need help here
If column A2 is less or equal to 70 and the sum for cells D2:AA2 is 50 I want it to say "more effort Please" for else to leave it blank. I have tried this but it is not working
IF((AND(A2<=70, SUM(D2:Aa2=50)), More effort please", " "))
Thanks

• Hi!

• Tatyanah says:

Thank you so much it worked very well

18. DAnna says:

here is what I'm trying to solve:

Cell could have the following data in it: apple, orange, grape, celery

Looking for an IF statement that would drop into another cell either fruit or veggie.

IF apple, orange, grape = fruit, if celery = veggie

hope that makes sense. Thanks for your help.

• DAnna says:

Happy to report that I figured it out!!! Thanks!

19. Linda says:

Hello,

I urgently need help here, how would I format:

If A1 is yes then B1 cell is color green with text "YES" or if A1 is no then cell B1 is red with text "NO"
Kind of like an attendance deal.

Also is there a way to say: if any in A1-A10 is YES then cell A12 is color green (no text) but if there is any NO then A12 is color red (no text).

I can't figure out the color element so I'd like to see both ways to see which one will be easier to implement.

Linda

20. RC says:

Hi! I need help on this:
this is for an exam..

If your answer is "no good", "hold" or "for reworks" the result is STRICT.

If your answer is "good", "hold" or "for reworks" the result is SWEET.

If your answer is "good" or "for reworks" the result is SWEET then STRICT if "no good".

If your answer is "good" the result is SWEET then STRICT if "no good" or "hold".

Thank you!

21. Usman Javed says:

Hi Boss,

Need your support to correct the formula for me.

=if(RC[-5]=7,RC[-1]>"00<"07:01","Achieved","Not Acheived")

• Hi!
I hope you have studied the recommendations in the tutorial above. It contains answers to your question

22. Jen J says:

Hi,

IF A2=0% OR B2=0% OR C2=0% OR D2=0%, then F2 is equal to (A2+B2+C2+D2)/3,

IF A2=0% AND B2=0%, then F2 is equal to (A2+B2+C2+D2)/2,

IF B2=0% AND C2=0%, then F2 is equal to (A2+B2+C2+D2)/2,

IF C2=0% AND D2=0%, then F2 is equal to (A2+B2+C2+D2)/2,

IF A2=0% AND D2=0%, then F2 is equal to (A2+B2+C2+D2)/2,

IF A2=0% AND B2=0% AND C2=0%, then F2 is equal to (A2+B2+C2+D2)/1,

IF A2=0% AND B2=0% AND D2=0%, then F2 is equal to (A2+B2+C2+D2)/1,

IF A2=0% AND C2=0% AND D2=0%, then F2 is equal to (A2+B2+C2+D2)/1,

IF B2=0% AND C2=0% AND D2=0%, then F2 is equal to (A2+B2+C2+D2)/1,

Thanks!

• Hello!
For example,

=IF(OR(A2=0,B2=0,C2=0,D2=0),A2+B2+C2+D2)/3

23. rom greg says:

Hi,
Is this formula correct? I need to find a value in another sheet
=IF(MATCH(A1,Sheet1!A:A,0),"TAGAYTAY", IF(MATCH(A1,Sheet1!B:B,0), "DASMA", IF(MATCH(A1,Sheet1!C:C,0), "NAIC")))

• rom greg says:

on the 1st IF statement the value of A1 is appearing, but when I tried on the 2nd IF statement the value returns #N/A

• Hello!
It is very difficult to understand a formula that contains unique references to your workbook worksheets. Hence, I cannot check its work, sorry.
Describe in detail what problem you have, and I will try to help you.

24. David Yurick says:

How do you put multiple values from different sheets to return those values separated by commas into one cell?

Sheet #1 is the Summary page with two columns: Column A: Names (A1: A28); Column B: (where I want to have all the attended conference names in the row w/ its respective name.)

Sheet #2, #3, #4, etc are the conference sheets that contain a table with Column A: Names (A1: A28), and the Conference name in cell C6.

What formula works to say, "If the name from Sheet #1 is listed in Sheet #2 (column A), then bring the conference name in cell C6 of that specific sheet, and add it to Sheet #1/Column B/row of that particular Name...and continue to concatenate all of these values into the same cell, separated by a comma.

Regards,
D\$

• Hello!

=CONCATENATE(IF(ISNUMBER(MATCH(A3,Sheet2!A1:A28,0)),Sheet2!C6,""),IF(ISNUMBER(MATCH(A3,Sheet3!A1:A28,0)),Sheet3!C6,""),IF(ISNUMBER(MATCH(A3,Sheet4!A1:A28,0)),Sheet4!C6,""))

=TEXTJOIN(",",TRUE,IF(ISNUMBER(MATCH(A3,Sheet2!A1:A28,0)),Sheet2!C6,""),IF(ISNUMBER(MATCH(A3,Sheet3!A1:A28,0)),Sheet3!C6,""),IF(ISNUMBER(MATCH(A3,Sheet4!A1:A28,0)),Sheet4!C6,""))

Please have a look at this article — TEXTJOIN function in Excel to merge text from multiple cells

25. SHABIRI says:

Hello!
My name is shabir
I'm looking for the formula that can count only 7 lowest grades out of range.
Example there are 12 subjects which students should sit for in every term. So to rank their positions a teacher needs to pick only 7 out of 12 subjects of which a student has performed better. Regarding that A = 1, B= 2, C= 3, D=4, And F =5

26. Jo-Isabel Longoria says:

Trying to figure out a formula. If "Exceeds" and High Potential" = 1 or "Meets" and High Potential" = 2 or "Low" and High Potential" = 3

• Hi!
Read above — Example 3. Using IF with AND & OR functions

27. Shiva Kumari says:

I have questions I have employees data I want to calculate commission according to their region wise give some conditions like in North region who r having above 5000 give 5% and 8000 to 10000 give 12% like that and same who r have south region above 5000 give 7% and 8000to 10000 give 12% like that I want how to write conditions in excel using formulas.

• Hi!

28. Agilan says:

I have 4 blank cells, every time I add a date in the 1st cell, a specific value should be returned, if not it should check the 2nd cell and if the 2nd cell has a date it should return another specific value and so on. I tried using the ISBLANK function but it does not work correct for me.

• Hello!

=IF(ISNUMBER(A1),B1,IF(ISNUMBER(A2),B2, IF(ISNUMBER(A3),B3,IF(ISNUMBER(A4),B4,"" ))))

Hope this is what you need.

29. Nate says:

Hello Alexander,

I'm afraid I have a similar problem to my previous SUMIF one further up the page, but with text instead.
I'd like to count the number of cells that have specific text, but only if a cell on the same row also has specific text.

In this case, I'd like to count the number of cells in column B that contain "Category M", but ONLY IF a cell in the same row in column G also contains "Yes". Is this clear enough?

Because it's text, I suspect SUMIF won't be applicable here. Any help is appreciated.

• Nate says:

I think I've solved the problem using COUNTIFS and multiple criteria. Thank you for all the help and advice you've given to everyone!

• Hello!
The formula below will do the trick for you:

=COUNT(IFERROR(SEARCH("Category M",B1:B10,1),"")*(--(G1:G10)="Yes"))

This is another way to solve your problem

30. A Shanmugasundaram says:

What is formulas for incentive calculation contains of this condition
<26day up to 28days rs40perday and 26 days incentive is "0")

31. Kimberly Johns says:

I have been working on this for a while and I know I am trying to overcomplicate but I cannot get this formula to cover the one oddball instance.
I have 3 columns B is my deal credit which will be either 50 for a split deal and 100 for a full deal. So if the deal is 50, the max amt to be paid is 100.00, if it is 100, the max paid is 200.00. Column C is the commission amt that has already been paid, so therefore if the deal is a split deal (50) and they have been paid 50.00, they are paid the difference which would be 50.00 which will go in column C. If the deal is a full deal (100) and the comm amt is 100.00 the amt paid would be 100.00 , the difference between the amt paid and the max amount.
Here is my formula: =IF(C4>=200,0, IF(B4=50,100-C4, IF(B4=100,200-C4))) It seems to work for them all except the one oddball instance where my comm amt for a half deal is 109.10, so it is leaving my column C with a minus amount of -9.10 which I would like to show up as a 0.
Thanks so much for your help. I hope I am not too confusing.

• Hello!
I didn't quite understand your calculations, but I suggest this formula

=IF(IF(C4>=200,0, IF(B4=50,100-C4, IF(B4=100,200-C4)))>0,IF(C4>=200,0, IF(B4=50,100-C4, IF(B4=100,200-C4))),0)

• Kimberly Johns says:

That worked! Thank you so much!

Hello Expert,

I need a formula with support following terms...

if i press a digit between 0 to 5000 then we received result "1"
5001 to 10000 = "2"
10001 to 15000 = "3"

200001 to 205000 = "41"
2000001 to 2005000 = "401"

5000 difference

=IF(C6<5000,"1",IF(C6<10000,"2",IF(C6<15000,"3",IF(C6<20000,"4","5".........................infinity))))

I need Solution of infinity

kindly help

• Hello!

=INT(A1/5000)+1

33. shannmugasundaram says:

working days lessthan 26day insentive value is "0"
working days Morethan 26day to 27 days insentive value is "40" per day Total value (26*40=1040),(27*40=1080)
working days Morethan 27day to 31 days insentive value is "40" per day Total value (28*60=1680),(29*60=1740),(30*60=1800) and (31*60=1860)
I want Formula

34. natalia says:

I have a list of names and emails, i need to confirm with a yes or no if the person paid some fees

im using this formula for the names in one cell:

and this one for the emails in another cell:

how can i make it just one formula in one cell, instead of 2 formulas in 2 different cells?

thank you so much!

• Hello!
Try this formula

• natalia says:

thank you so much!!! it works :)

35. Moe says:

Create a column called “Credit”. If the “Score” of the customer is “less than” 40, then give a “Poor” value in the Credit column. If the “Score” of the customer is “equal to” or “higher than” 40 but “equal to” or “less than” 70, then give an “OK” value. If the “Score” of the customer is “higher than” 70 but “less than” 90, then give a “Good” value. If the “Score” of the customer is “equal to” or “higher than” 90, then give an “Excellent” value. You must use a lookup function WITH an ARRAY Form for this column. Be sure that you implement the EXACT cutoff here using a range of scores with no more than 4 rows. No points will be given for using IF function.

• Hi!
I recommend reading this guide: How to Vlookup for approximate match

• Moe says:

this what the professor said.
"You must use a lookup function WITH an ARRAY Form for this column. Be sure that you implement the EXACT cutoff here using a range of scores with no more than 4 rows."

• Hi!
Try the following formula:

=VLOOKUP(B2,{0,"Poor";40,"OK";70,"Good";90,"Excellent"},2,1)

This is Vlookup for approximate match

36. Usha says:

Hi,

Would like to calculate some valuse.

Example day counts the person one who resolves the calls in counts per day ranges is like mentioned below

1. 1 calls =Rs.75

2. 2 calls=Rs.150

3. >3 calls =Flat Rs.300

Blanck should not consider.

37. Allan says:

Hello,

I've tried the formula below however the forth IF doesn't give a logical answer. Would you please assist:

=IF(G4<5,H4,IF(G4=10,H4+4,IF(G4>=15,H4+6,))))

G4 = years of seniority
H4 = annual leave entitlement
My objectif is to increase 2 days of leave entitlement every 5 years

• Hello!

=(INT(G4/5)-1)*2+2

38. Mike Fiifi says:

Hi, I am using a "if" and "and" combination but I'm not getting it right please help me with this.

If(and(A1>0,b1>0),(average(A1,b1)),(A1,b1)

How do I correct the false section of this statement if there are options to choose from two alternatives for that

• Mike Fiifi says:

A1=4 B1=5
A2=6 B2=0
A3=0 B3=3

So basically I want to find the averages of these two columns such that cells containing zeros are not ignored. For example the average for A1 and B1 is 4.5. Ideally the average of A2 and B2 will be 3 but I want Excel to write 6 instead and then 3 for A3 and B3 and not 1.5

• Hello!
If I understand your task correctly, the following formula should work for you:

=IF(AND(A2>0,B2>0),AVERAGE(A2:B2),MAX(A2:B2))

39. Shannon says:

Hello!

I'm trying to use the following formula for a commision function but I've obviously got something wrong. Can you please help me? Thanks so much!

=IF(H4>=25%,10%,IF(H4>=30%,15%,IF(H4>=35%,20%,IF(H4>=40%,25%))))

• Hi!
The formula below will do the trick for you:

=IF(H4>=40%,25%,IF(H4>=35%,20%,IF(H4>=30%,15%,IF(H4>=25%,10%))))

• Shannon F Bass says:

Thanks so much!!

40. Kellsta says:

I have a formula that I want to make more specific
=IF(AND(AM5="WASE-AH", (OR(U5="OVERSEAS/INELIGIBLE",U5="PRISONER", U5="T.A.C.", U5="VETERANS AFFAIRS", U5="WORKCOVER")),P5="4"),"Check", "Ignore")

but I want to add for each item another set of criteria against cell F5 to check
If u5= "overseas/ineligible" and F5= I then ignore, else check.
If u5= "PRISONER" and F5= PR, then ignore, else check and so on for all the claim types.
P5 still also needs to =4

41. murugan says:

Hey Hi,

i have some doubts,

if john and peter 2 peoples is available

john is 10
peter is 10

if the name is john i need +2 for example 10+2 = 12
if the name is peter i need +4 for example 10+4 = 14

wherever i see john name is 12 instead of 10
wherever i see peter name is 14 instead of 10

• Hi!
I hope you have studied the recommendations in the tutorial above. It contains answers to your question.

42. Betty R. says:

I read through this article and came up with this for the project I'm working on. But it's not working. Please let me know what I need to do to fix this.

=IF(AND(\$A2=”Conduct”,\$F2="Final"), "Location 01", IF(AND(\$A2=”Development”,\$F2="Final"), " Location 02", IF(AND(\$A2=”Development and Amendment”,\$F2="Final"), " Location 03")))

Thanks,
Betty

• Hello!
Unfortunately, without seeing your data it is difficult to give you any advice. The formula contains no errors. But I cannot check its work, sorry.

• Betty R. says:

Do you need to see the excel file? If so, how do I send it to you?
Thanks

• Betty R. says:

Hello again,

I got it to work! Thanks so much for publishing this article.

43. Lala says:

Hi,

I want to ask I need to sum A2 + B2 and the total in column C2 and if the total C2 is more than 100 it will display the balance in column D2.

• Hello!
Formula in cell D2 -

=IF((A2+B2)>100,A2+B2,"")

44. jasmeet says:

Hi,
cell A2 contain6/2/21 7:14 PM
If the value for A2 is between 7:30 PM to 10:30 PM and the day of the week is Tuesday, then the value should be a text "ABCZYZ"

• Hello!
If I understand your task correctly, the following formula should work for you:

=IF(AND(WEEKDAY(D1,2)=2,(D1-INT(D1)>19.5/24),(D1-INT(D1)<22.5/24)),"ABCZYZ","")

• jasmeet singh says:

Hi Alexander,
Thank you so much for the swift response.
I need help with another formula. There are 2 sheets in excel:
Sheet1 :
Date start time End Time Analyst
1/5/2021 7:30 13:30 ANALYST1
1/5/2021 13:30 16:00 ANALYST2
1/5/2021 16:00 18:30 ANALYST3
1/5/2021 18:30 21:00 ANALYST4
1/5/2021 21:00 0:00 ANALYST5
1/5/2021 0:00 3:00 ANALYST6
1/6/2021 7:30 13:30 ANALYST1
1/6/2021 13:30 16:00 ANALYST2
1/6/2021 16:00 18:30 ANALYST3
1/6/2021 18:30 19:00 ANALYST4
1/6/2021 21:00 0:00 ANALYST5
1/6/2021 0:00 3:00 ANALYST6
Sheet 2:
1/5/21 5:32 AM
1/5/21 3:39 PM
1/5/21 3:45 PM
1/5/21 7:05 PM
1/5/21 8:51 PM
1/5/21 10:47 PM
1/5/21 12:57 AM
1/6/21 5:05 PM
1/6/21 7:53 PM
1/6/21 9:13 PM
1/6/21 11:50 PM
1/6/21 5:53 PM
1/6/21 11:36 PM
1/6/21 6:11 PM
1/6/21 6:15 PM
1/6/21 7:03 PM
1/6/21 7:03 PM
1/6/21 7:03 PM
1/6/21 7:03 PM

I want a formula to find out the name of the analyst who is responsible as per sheet 2 data. For instance, 1/5/21 3:39 PM incident is for Analys2 or 1/6/21 9:13 PM should pull up Analyst 5. In other words, if the date in sheet 2 matches the date in sheet 1 then the time in sheet 2 for the same date should look up the value in start time and end time of sheet 1 and populate the value for the Analyst.

Thanks,
Jasmeet Singh

• Hello!
The formula below will do the trick for you:

=INDEX(D1:D12,MATCH(1,(INT(F1)=A1:A12)*(F1>A1:A12+B1:B12)*(F1Excel INDEX MATCH with multiple criteria

• jasmeet singh says:

Hi Alexander,
Thank you so much for sharing the formula.
I have tried but it is not giving me value as N/A. Can you please share the complete formula.
This would be of a great help as I have some deliverables and need this urgent. This will be of a great great help.

Thanks,
Jasmeet Singh

• jasmeet singh says:

Hi Alexander,
Apologies to pester you.

To add to this, the Sheet 2 has 2 columns not 1:
Column1 : Date
Colum 2 : time

Thanks,
Jasmeet Singh

• Hello!
An NA error means that the required value was not found. The IFERROR function can be used.

Also, note that the time interval is incorrect:
1/5/2021 21:00 0:00
00:00 is the beginning of the day. The interval from 21:00 to 00:00 is nonsensical. Use 21:00 23:59

• jasmeet singh says:

Hi,
I have put all the values given above in one sheet from column A2 to F12 and applied the above given formula in G2, however no result is displayed. The column F contains both date and time, such as 1/5/21 5:32 AM. Please see the formula below:

=IFERROR(INDEX(D2:D12,MATCH(1,INT(K2)=A2:A12)*(K2>A2:A12+B2:B12)*(K2<A2:A12+C2:C12),0),"REVIEW")
It only shows "REVIEW".

Thanks,
Jasmeet Singh

• Hi!
The formula I sent to you was created based on the description you provided in your first request. However, as far as I can see from your second comment, your task is now different from the original one. Hence, the formula fails to work. I'm sorry for the wasted time. When I have more time, I will think of another formula.

45. suli says:

I have the following

A1 = Yes
B1 = a Date
C1 = a string of 6 digit number with a letter

I want D1 to have the Value "Fully Verified" if all three cells in the row are filled.
If either B1 or C1 is blank, the return value in D1 to be "Not Verified"
If both B1 and C1 are blank, the return value in D1 to be "Not Verified"

What formula will suit this argument and how can that be arranged to give the desired return value?

Thanks ...

• Hello!
The formula below will do the trick for you:

=CHOOSE((A1<>"")+(B1<>"")*2+(C1<>"")*4,"NV","","NV","","NV","","FV")

46. jasmeet singh says:

Hi Alexander,
Requesting you to please help me find the formula for the situation that we discussed the other day.
Thanks,
Jasmeet Singh

47. George Jembe says:

Am developing an incentive and the entry level is 91 scoring 8% and the maximum is 253 scoring 15%. If one scores below 91 thats a zero and if they score more than 253 they earn 15%. What is the formula that will calculate anything between 91 and 253?

• Hi!
What result do you want to get exactly? What do you want to calculate between 91 and 253? Write an example of the source data and the result you want to get.

48. ANKIT says:

Hi Friends,

pls can u help me to get the formula for example ive explained below

if B2 cell value is greater than c2 cell value (good) or d2 cell value(very good) or e2 cell value (excellent)

i want to get this good or very good or excellent comments in F2 cell

• Hi!

• Ankit says:

thx for ur reply, just chked it but my point is i want to take cell values dnt need have particular numbers,

eg:

B3 cell value is 50, D3 cell value is 51, E3 cell value is 60 and F3 cell value is 61

=CHOOSE((B3>=D3) + (B3>=E3) + (E3>=F3), "GOOD", "VERYGOOD", "EXCELLENT")

So how to use cell value instead of any number

• Hello!
I’m not sure I got you right since the description you provided is not entirely clear. However, it seems to me that the formula below will work for you:

=CHOOSE((B3>=D3) + (B3>=E3) + (F3>=F3), "","GOOD", "VERYGOOD", "EXCELLENT")

If this is not what you need, explain what kind of result you would like to get in your example.

49. nesreen says:

i want to fill cell variable values from 1 to 9 according to the many conditions
i used this formula but not reflect result

• Hi!
I am not sure I fully understand what you mean. For me to be able to help you better, please describe your task in more detail. Please specify what you were trying to find, what formula you used and what problem or error occurred. Give an example of the source data and the expected result.