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.

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.

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:

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")`

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.

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.

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

For more information about Excel IF with multiple conditions, please see How to use nested IF in Excel.

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.

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.

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:

- How to use the COUNTIF in Excel
- Using Excel COUNTIFS and COUNTIF with multiple conditions
- SUMIF in Excel - formula examples to conditionally sum cells
- How to use Excel SUMIFS and SUMIF with multiple criteria

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", "")))`

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:

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!

Excel formulas
CSV
Excel functions
Print
Financial functions
Vlookup
Merge data in Excel
SumIf
CountIf
Excel Compare
If statement
Excel Charts
Pivot Table
Conditional formatting
Excel formatting
Excel duplicates
Excel date
Excel tips
Excel macro
Outlook
Google Sheets
Outlook duplicates
Shared email templates

Category: Excel Tips

60+ professional tools for Excel

2019–2010 to do your daily work

2019–2010 to do your daily work

Incredible product, even better tech support…AbleBits totally delivers!

Deborah Bryant

Anyone who works with Excel is sure to find their work made easier

Jackie Lee

The best spent money on software I've ever spent!

Patrick Raugh

Ablebits is a fantastic product - easy to use and so efficient.

Debra Celmer

Excel is at its best now

Annie C.

I don't know how to thank you enough for your Excel add-ins

Jennifer Morningstar

Anybody who experiences it, is bound to love it!

Kumar Nepa

AbleBits suite has really helped me when I was in a crunch!

Nelda Fink

I have enjoyed every bit of it and time am using it

Christian Onyekachi Nwosu

It's the best $100 we've ever spent!

Mike Cavanagh

I love the program, and I can't imagine using Excel without it!

Robert Madsen

One word… WOW!

Dave Brown

Love the products!

David Johnston

It is like having an expert at my shoulder helping me…

Linda Shakespeare

Your software really helps make my job easier

Jeannie C.

Thanks for a terrific product that is worth every single cent!

Dianne Young

I love your product

Brad Gibson

Awesome!!!

Sheila Blanchard

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

Hello! I need a formula to display a scholarship.

These are the conditions:

if final_grade < 8 print “No receive”;

• 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!

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

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.

C6=GRADE

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

Hello!

Please re-check the Nested IFs example since it covers your task.

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

=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!

Please try the following formula:

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

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.

Found really useful thank you!

Please provide formula :

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

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"))

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,""))))

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

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) ?

Hi!

Please have a look at this article: Nested IF in Excel – formula with multiple conditions

I hope it’ll be helpful.

If you have any other questions, please don’t hesitate to ask.

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?

=IF(AND(D12=2,D13=1),HYPERLINK("https://test1.jpg","View Layout"),"")

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

=IF(AND(D12=2,D13=1),HYPERLINK("https://test1.jpg","View Layout"),IF(AND(D12=5,D13=2),HYPERLINK("https://test2.jpg","View Layout"),"")...so on and so on

Thanks,

Kyle

Hello!

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

=HYPERLINK(IF(AND(D12=2,D13=1),"https://test1.jpg", IF(AND(D12=5,D13=2),"https://test2.jpg","")), IF(AND(D12=5,D13=2),"view2", IF(AND(D12=2,D13=1),"view1","")))

You can learn more about HYPERLINK function in Excel in this article on our blog.

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

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

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.

I hope it’ll be helpful. If something is still unclear, please feel free to ask.

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)

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)

I hope I answered your question. If something is still unclear, please feel free to ask.

I got it.. thank you😊

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!

Please try the following formula:

=IF((AND(A2<=70,SUM(D2:AA2)=50)),"More effort please"," ")

Thank you so much it worked very well

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.

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

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.

Thanks in advance!!

Linda

Hello!

You can find the examples and detailed instructions here: Excel conditional formatting formulas

=SUM(--(A1:A10="Yes"))>0

I hope it’ll be helpful.

Hi! I need help on this:

this is for an exam..

Correct answer: Good

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

Correct answer: No good

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

Correct answer: "Hold"

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

Correct answer is: For reworks

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

Thank you!

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

Hi,

Please help me in this IF function formula. So far I cannot get it work.

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!

Please re-check the article above since it covers your task.

For example,

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

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")))

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.

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.

Thank you for your help.

Regards,

D$

Hello!

I believe the following formula will help you solve your task:

=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,""))

You can learn more about MATCH function in Excel in this article on our blog.

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

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

Please help

Hello!

Here is the article that may be helpful to you: SMALL IF in Excel: get Nth smallest value with criteria.

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

It contains answers to your question

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!

I recommend reading the comments here and here.

This should solve your task.

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!

Please try the following formula:

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

Hope this is what you need.

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.

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

What is formulas for incentive calculation contains of this condition

<26day up to 28days rs40perday and 26 days incentive is "0")

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)

I hope it’ll be helpful.

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!

If I got you right, the formula below will help you with your task:

=INT(A1/5000)+1

You can learn more about INT function in Excel in this article on our blog.

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

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:

=IFNA(IF(VLOOKUP(A14,Table1[[#All],[Name of Person]],1,0)=A14,"yes","no"),"not found")

and this one for the emails in another cell:

=IFNA(IF(VLOOKUP(B14,Table1[Email],1,0)=B14,"yes","no"),"not found")

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

=IFNA(IF(VLOOKUP(A14,Table1[[#All],[Name of Person]],1,0)=A14,”yes”,”no”),IFNA(IF(VLOOKUP(B14,Table1[Email],1,0)=B14,”yes”,”no”),”not found”))

thank you so much!!! it works :)

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

can you please help me to find a formula for this question.

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

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.

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!

Please try the following formula:

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

You can learn more about INT function in Excel in this article on our blog.

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

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

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%))))

Thanks so much!!

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

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

i need to know the formula... please help me

Hi!

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

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.

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

Thanks

Hello again,

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

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,"")

Hi,

Please help me finding the following:

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","")

You can learn more about WEEKDAY function in Excel in this article on our blog.

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

I hope it’ll be helpful.

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

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.

=IFERROR(INDEX(D1:D12,MATCH(1,(INT(F1)=A1:A12)*(F1>A1:A12+B1:B12)*(F1this article to learn how to use IFERROR in Excel.

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

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

Please help to fix this.

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.

Can someone assist please?

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")

You can learn more about CHOOSE function in Excel in this article on our blog.

Hi Alexander,

Requesting you to please help me find the formula for the situation that we discussed the other day.

Thanks,

Jasmeet Singh

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.

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!

Please re-check the article above since it covers your case.

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.

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.