Comments on: Excel IF statement with multiple conditions

For powerful data analysis, you may often need to build an Excel IF statement with multiple conditions or use IF together with other functions. This tutorial will show you the most effective ways to do this. Continue reading

Comments page 113. Total comments: 4573

  1. I am working on the excel sheet in which i have to put the following conditions like
    if gpa is in the range of 3.81- 4.00 then assign the marks 20
    if the gpa in the range of 3.61- 3.80 then assign the marks 10 and so on for the other gpa what is the solution to this kindly any one can help me
    Thanks

    1. Hi Nayab,

      You can write a nested If formula similar to this:

      =IF(A1>3.8, 20, IF(A1>3.6, 10, IF(...)))

  2. Hello
    I would like to know how to use nested loop functions with logical operator AND, using data from columns in different sheets.
    Like for instance, if there has to be condition placed such that if Column D in Sheet1 AND Column D in Sheet2 AND Column D in Sheet3 AND Column D in Sheet4 are true, the result is RANK1 in Column B in Sheet5?
    How to go about it? I hope I have made myself clear.

  3. Hi
    am trying to create a formula in excel 2010
    =IF(C5=10918,(IF(AY5*0.02<10,10,IF(AY5<0,0,AY5*0.02))),IF(C5=14449,IF(D5=0,0,(D5-S5)/1.145)),IF(C5=32466,IF(D5*0.02<10,10,D5*0.02))
    but it is showing too many arguments for this functions, am planing to use more thn 50 ifs here, is it even possible??

  4. Hi,

    I am trying to create a formula that will insert one of four colored symbols. For example if cell value is >= 96% insert solid blue circle, if btwn 93% and 96% insert solid green circle. Etc.

    Thanks for your help!

  5. hi
    have prep this string
    =CONCATENATE(IF(C2=10918,(IF(AY2*0.02<10,10,IF(AY2<0,0,AY2*0.02))),IF(C2=14449,(D2-S2/1.145))),IF(C2=17178,(IF(D2=0,0,IF(D2<230,4,D2*2/100)))),IF(C2=32466,IF(D2=0,0,IF(D20.4,VLOOKUP(C2,'Merchant ID'!A:E,3,0))*D2)
    but am getting
    FALSEFALSE100
    am confused what am doing wrong, help me out?

  6. =IF(D8>D34,5,IF(D8=D34,4,IF(AND(D8=(D34-2)),2,IF(AND(D8=(D34-3)),1,IF(D8<=0%,0)))))

    Id like to correct my previous, This is my actual formula

  7. I've been trying to create formula on this:

    Higher than inflation rate, the score is 5
    Within inflation rate, score is 4
    2 points below inflation rate, score is 2
    3 points or more below the inflation rate, score is 1
    At 0% or negative, score is 0.

    So I entered the following formula, where D8 contains the score, and D34 is where I entered the inflation rate. But it doesn't work.

    =IF(D8>D34,5,IF(D8=D34,4,IF(AND(D8=(D34-2)),2,IF(AND(D8=(D34-3)),1,IF(D8<=0%,0)))))

  8. I'm trying to create 5 new character variables from a set of 5 existing variables (test scores - math, lang, phys, soci, comp). The goal is to create a new variable for each score, based on a set of cutpoints of the test score. The comp variable -- a summary or overall variable -- can be either numeric or character. The two character options for comp are "Incomplete" and "Other", and are valid values when there is a missing score for any one of the the other 4 variables. Let's say that the first row of 5 original variables are in cells A2, B2, C2, D2, and E2. If there are numeric values in each of those cells, the formula would be written: =IF(A2>=270|"Demonstrating"|IF(A2<258|"Emerging"|"Approaching")). Where I'm stuck is in writing the formula for when there is a blank value in one of the 4 test score fields (A2, for example). Can you help?

  9. There are 1000 values in one column (C). I need to populate the value '1', if the value in column (C) is equal to 'A','B','C','D' or 'E'. Else, I need it to populate zero. Basically, my simple formula of =if(C1="A",1,0) needs to be extended to A or B or C or D or E - all in one cell formula itself.

    1. Hi Gurgaa,

      Simply embed the OR function in your formula, like this:

      =if(OR(C1="A", C1="B", C1="C", C1="D"), 1, 0)

  10. Hello dear Svetlana,
    If add one more part that is, if cell5 (total) be between 50 and 59 grade C, between 60 and 79 B, between 80 and 100 grade A (for level1,level2 and level3). if cell5(total be between 60 and 65 grade C, between 65 and 79 grade B, between 80 and 100 grade A.
    your kindness will be highly appreciated.

    1. Hi Gul Mohammad,

      You can use the following nested If functions to display grades in a separate cell:

      =IF(AND(OR(A4="level1", A4="level2", A4="level3", A4="level4", A4="level5"), A5>=80), "A", IF(AND(OR(A4="level1", A4="level2", A4="level3"), A5>=60), "B", IF(AND(OR(A4="level1", A4="level2", A4="level3"), A5>=50), "C", IF(AND(OR(A4="level4", A4="level5"), A5>=65), "B", IF(AND(OR(A4="level4", A4="level5"), A5>=60), "C", "")))))

      1. Hi Svetlana:
        I think you missed one and that is,you have not specified the Grade A for level four and level five. Now how do i continue?
        should I just add like the others?

        1. Hi Gul Mohammad,

          Because Grade A is identical (between 80 and 100) for all the levels, I added 5 levels in the first logical test to make the formula a bit more compact.

  11. If you don't mind one more problem that I faced with, and really disturbs me is that how to solve this of course it is in connection with previous.
    if cell4= level1,level2,level3 and at the same time total(cell5) be greater than 50 pass and otherwise fail and at the same time if total be between 50 and 59 that grade must be C, if between 60 and 79 grade must be B and if between 80 and 100 grade must be A.
    But if cell4= level4,level5 and at the same time cell5(total) be greater than 60, rusult be pass and otherwise fail and at the same time if cell5(total) be between 60 and 65 grade C, between 65 and 79 grade B, between 80 and 100 grade A.
    Thank you so much once again.

  12. Thank you too much for helping us. I will appreciate if you could help me with this function.Suppose if cell4= level1,level2,level3 and at the same time cell5(total score) be greater than 50,the student is pass otherwise fail.
    And again if cell4= level4,level5 and at the same time cell5(total score) be greater than 60, the student is pass otherwise fail.
    It will be your kindness if you could help to handle it.

    1. Hello Gul Mohammad,

      Try the following formula:

      =IF(OR(AND(OR(A4="level1", A4="level2", A4="level3"), A5>50), AND(OR(A4="level4", A4="level5"), A5>60)), "pass", "fail")

      1. Thank you so much dear Svetlana Cheusheva.
        It really helps me.
        I appreciate your helping and also your talent.
        best wishes

  13. Is there any formula for the condition where have to use "OR" more than twice.
    ex:
    A B C D Y=YES
    Y N N Y N=NO

    I want a condition : =if(A OR B OR C OR D ="Y","AGREE","NA")

    i want to use "or" more than twice. Is it possible?

    1. Hello Naveen,

      Of course, it's possible. Like in any other Excel function, you can include up to 255 arguments in an OR statement as long as the total length of your formula does not exceed 8,192 characters :)

      =IF(OR(A1="Y", B1="Y", C1="Y", D1="Y"),"AGREE","NA")

      1. Hi Svetlana,

        For Naveen's query we could also use this formula

        =IF(B1="A","Y",IF(B1="B","Y",IF(B1="C","Y",IF(B1="D","Y",IF(B1="Y","N",IF(B1="N","N"""))))))

        Substituting any other text for "Y" or "N" within the brackets.

        But don't you think that a Table with the two columns - one with the condition and other with the output/result, will help this problem with a Vlookup formula. The table can be expanded without having to expand the formula or make it more complex.
        I have been using this method with excellent results and as an Excel professional I would be glad to know your views.
        Regards,
        Ramki

  14. hi I need help for the following

    BIO Scheme above 35
    Maths Scheme above 40
    Technology scheme above 45
    Arts Scheme above 55

  15. Hi,

    I'm looking for help with a formula:

    =IFERROR(IF(H9>90%,H9*G9,"-")

    H9 is the % Accomplished, G9 is the Value. The problem I am having is I need the % accomplished to max out at 100%

    Thanks

  16. its related to end of service calculation

    as per our policy, first 5 years of service, gratuity will be 1 month for each year( ie 30 days X 5) and next 5 years, it is 1.5 month (5and remaining service period it is 2 months.

    what should be formula which will check 4 year service, 8 year service and 12 year service.

    kindly help me.
    thanks

    1. Hi Krishna,

      Based on the information provided in your post I give below the formula which should work for you:
      A B C D
      2 Years worked Months earned
      3 6 6.5
      4 Cross check calculation
      5 Year split Entitled Months
      6 5 1 5
      7 1 1.5 1.5
      8 0 2 0
      9 Total 6.5

      IF(B25,IF(B210,(5*1)+(5*1.5)+(B2-10)*2,0))))

      Let me know if this worked for you,

      Regards,
      Ramki

  17. Hi Esther,

    If you are looking for a match of percentage ranges and the matching values then a lookup table and Vlookup formula can solve your requirement. I can send you the file with the formula and the information I think you are working with.

  18. Hi. Need help for the following.

    Above 90% 0
    Below 90% to 87% 200
    Below 87% to 85% 400
    Below 85% to 83% 600
    Below 83% 1,200

    This does not work (M11 = Result)
    =IF(AND(M11>=87%,M11=85%,M11=83%,M11<=85%),K11,IF(AND(M1190%,"")))))

  19. I need help in formulating a complicated IF statement.

    So I want a spreadsheet that has one cell that will calculate the correct percentage that is marked with an "X". (However there are five different percentage choices that can be marked are 2%,3%,4%,5% and 6%.)

    I started the following Nested IF formula but I'm screwing it up, maybe I need to use an IF/OR formula but can you please help me?

    =IF(E4="X",(D4*0.02),0,IF(F4="X",(D4*0.03),0,IF(G4="X",(D4*0.04),0,IF(H4="X",(D4*.05),0,if(G4="X",(D4*.06))))

    1. Hi Gabriel,

      I think a nested If formula is the right approach. Try this one:

      =IF(E4="X", D4*0.02, IF(F4="X", D4*0.03, IF(G4="X", D4*0.04, IF(H4="X", D4*0.05, IF(G4="X", D4*0.06, "")))))

  20. Hi, Just need some help in creating the formulas for these conditions. Hope you can help me.

    If Taxable Income is: Tax Due is:

    Not over 10,000 5%
    Over 10,000 but not over 30,000 500 + 10% of the excess over 10,000
    Over 30,000 but not over 70,000 2,500 + 15% of the excess over 30,000

  21. Hi Rebecca,

    Try the following nested If's:

    =IF(A1>4999, A1*15%, IF(A1>2999, A1*12%, IF(A1>594, A1*10%, "")))

    1. Thank you so much for your help!

  22. I'm trying to work on a formula for my new employer but I keep getting an error message. Here is what I need it to do:

    If A1 = $595 thru $2999 multiply by 10%, but if it = $3000 thru $4999 then multiply by 12%, but if it = greater than $5000 then multiply by 15%.

    Please help! Getting frustrated trying. TIA

  23. Hi,

    Please advise if I can use the if condition in vlookup. I want to pull data from reference 3, reference 1 and 2 is blank.

    Please advise.

    Regards,
    Arvind

  24. i have a question regarding the first example: IF/AND formula: =IF((AND(C2>=20, D2>=30)), "Pass", "Fail")

    Does the order in the "AND" segment matter? I.E. if it was IF((AND(D2>=30, C2>=20)), "Pass", "Fail"), would that change the result?

    1. Hi Kevin,

      The order of arguments in AND and OR statements does not matter at all. You can put them in any order and the result will be the same.

  25. Hi, I want to achieve a dollar value and I have created this =IF(F9>2888, "100", IF(F9>1588, "50")). But I have getting 50 and 100 as a text even I try to convert it into number.

    Can help?

    1. Hi Kerine,

      The point is that Excel interprets any value enclosed in double quotes as a text value. So, simply remove the double quotes surrounding 100 and 50, and your formula will work fine:
      =IF(F9>2888, 100, IF(F9>1588, 50))

  26. Thank you so very much for this very helpful / educational posts Ms. Cheusheva.

  27. I want to use If A1 = "82041100 / 82041200 / 82042000" and A2 = "China" then A3 = 150 otherwise 200. Could any one tell me what would be the syntax of the that formula in excel.

    1. Hi Muddassir,

      If you mean A1 contains exactly that text string, use this formula:

      =IF(AND(A1="82041100 / 82041200 / 82042000", A2="China"), 150, 200)

      If you mean A1 contains any of those 3 numbers, use this one:

      =IF(AND(OR(A1=82041100, A1=82041200, A1=82042000), A2="China"), 150, 200)

  28. Sorry i have redo this

    Hi i want to achieve this, Results should be in D5
    Can anyone help me out. Both conditions has to be met.

    if C8 68%>= 74.99% Results in Cell D5=200 if C8 >=75%, D5=300
    AND
    if C9 68%>=75% , then D5=300
    if C8 and C9 <68% then D5=0.00

  29. Hi i want to achieve this, Results should be D5
    Can anyone help me out. Both conditions has to be met.

    C8 68 between 74.99 Results D=200 if C8 >=75%, D=300
    AND
    C9 68%>==75% , D=300
    if C8 and C9 <68% then D=0.00

  30. Hello,

    I am trying to write a IF function in excel but not successful :(

    I want to write a formula for percentage calculation IF the column is an integer. No percentage calculation if the column zero and not an integer.

    Hope to receive your reply. Thanks.

    1. Hi Terrance,

      You can use a formula similar to this (just replace A1*10% with the percentage calculation you want):

      =IF(AND(A1<>0, INT(A1)=A1), A1*10%, "")

  31. Hi there.

    I would like to request how to make a formula for our delivery timeline using the following conditions for Orders made on weekdays, weekends and cutoff time (for weekday orders).

    Scenario A
    Condition 1: Delivery Address - Provincial
    Condition 2: Order Date: Weekday
    Condition 3: Order time is before 3PM
    Action: Add 5 days to the order date excluding weekends

    Scenario B
    Condition 1: Delivery Address - Provincial
    Condition 2: Order date: Weekend
    Condition 3: Order time (N/A)
    Action: Add 4 days from Monday= friday

    Thanks

  32. It has been very helpful for me and thank you.

  33. If there is word "No" in column A, word #N/A in column B and word "No" in column C, i want the formula so that output is "No" or else it should be "Yes"

  34. Hi,
    I want to use the following function, can I?
    IF(A1=0;B2=A1*S3;B2=A8*S6)

    Regards,

    1. Hi Shaher,

      If you are writing a formula for B2, you don't need to reference it in the formula:

      =IF(A1=0; A1*S3; A8*S6)

  35. Hi Svetlana,

    This is very useful. Appreciate your effort. Cheers!! :)

  36. I am looking for an if, and statement the uses vlookup. I keep getting an error but can't figure it out. I want all 3 conditions to be true to give a 1 if they are in the cell. If not then use the cell in another cell on another tab. This is what I have:
    =IF(AND(B48="7R",O48="No Repair Program",vlookup(a48,'Att. A-G'!$A$10:$bj$48,62=0),1,VLOOKUP(A48,'Att. D NIIN DATA'!$A$12:$AG$56,14,FALSE)))

  37. i have problem in IF condition in Excel. B1 is drop down i select one value the automatically how to change in B2. like this........

    B1=dropdown 1,2,3
    B2=values like 1=6.2
    2=5.6
    3=6.6
    how can do this problem please tel me or send answer my mail
    thanking you

    1. =IF(H17=1,6.2,IF(H17=2,5.6,IF(H17=3,6.6)))

      thank you

  38. i have small problem in excel. it is i am created a drop down in the excel. like this Ex: B is 1,2,3,4,5.... and C is 45,56,59,58,26..
    but iam select B1 then automatically C Cell become changed into 45.
    how is it please solve my problem. thanking you

  39. =IF(N15=4,0%))))

    I wrote the formula above, but it is returning "False" insteady of an actual number, anybody can help to identify how I can correct this?

    1. this formula was treated =0 why because u r typing in cell N15 some other vales give like 3 or 10. that is not correct vales. the correct vale is only 4. but why u r give IF condition like Cell N15=0% after give in cell N15.
      =IF(N15=4,0%)

  40. Hi,
    Here is my formula. its not working.
    =IF(AND(AR2>=0.9, AR2<=0.7), "C", IF(AND(AR2=0.5), "B",IF(AND(AR2=0.1), "A", "D")))

    I am setting up KPI metrics, so based on the data, i have named each value in categories.
    If X is between 0.9 to 0.7 = C,0.6 to 0.5=B, 0.4 to 0.1=A, then if is over 0.9=D

    1. Hi
      Sri

      =IF(AR2>0.9,"D",IF(AR2<=0.4,"A",IF(AR2<=0.6,"B",IF(AR2<=0.9,"C"))))

      Regards
      Manish

  41. Thanks, these examples are very helpful

  42. $125/100 people or part thereof
    I used the following formula:
    =B19*IF(B4>100,IF(B4>200,IF(B4>300,IF(B4>400,IF(B4>500,6,5),4),3),2),1)

    Is there is a better method or function that could be used?

    Also for, requires 1 person per 50 tickets sold, minimum of 5 security personnel at an event. Evening events are charged a flat rate of $200/security person.

    I used,
    =B21*IF(B4>250,IF(B4>300,IF(B4>350,IF(B4>400,IF(B4>450,IF(B4>500,11,10),9),8),7),6),5)

  43. F347874 is 30-Jun-14

    why this formula is showing false

    IF(AND(F347874>"03-31-2014",F347874<="09-30-2014")

    Please help

  44. All data is in descriptive form .

  45. I tried one formula for counting no entries but it won't work.

    =count(if(C1=Sheet1C2),C2:C60)

  46. I need an IF formula to reflect this information:
    If cell A1 equals:
    Weighted % Points
    20%+=3
    10.1-20%=2
    5.1-10%=1
    0-5%=0

    1. IF(A1<5%,0,IF(A1<=10%,1,IF(A1<=20%,2,3)))

  47. I think I have a simple request but have been unable to figure this out.
    Cell A1 is used for a price to be input.
    Cell B1 needs to output a fee based on the price input into cell A1

    The parameters would be as follows:
    In A1 $1999 and below should equal $125 in B1
    In A1 $2000-$4999 should equal $225 in B1
    $4999 and greater should equal A1*.05

    Ive tried IF, AND, & OR functions and I can't get it. Please help.

    1. Hi Terrence,

      You can use the following nested IF's:

      =IF(A1>4999, A1*0.05, IF(A1>1999, 225, 125))

      1. Thanks!

  48. Hi,

    I'm a little stuck and I'm hoping I'm trying to use the right formula!

    I'm making a document to manage when our contractors are working and our margin.

    I need a formula that will work out our margin based on if they are getting paid daily or hourly, thus is cell C35 says Daily I need it to multiply D35 (The margin) by 5, and if it says Hourly it needs to multiply D35 by 37.5.

    Thanks in advanced!

    Abbie

  49. HI
    I'm trying to have an one cell answer (A1) that takes IF from multiple columns. If B1 is 1 then write "Apple", if it's empty, don't write anything. If C1 is 1 then write "Banana", (if empty don't write anything). If D1 is 1 then give "Orange"....

    If say B1 and C1 have "1" then the cell should give Apple, Banana.

    Many thanks in advance
    Diana

  50. Hello,

    I'm trying to create a series of columns, the number of which rely upon a set period of time entered by the user (Each represents a week). The date for one column relies on the date of the previous:

    =IF(PREVIOUS COLUMN+7 <= END DATE, PREVIOUS COLUMN+7,"")

    However this condition causes #VALUE! errors after the last column, so I tried to use the IFERROR function:

    =IFERROR(IF(PREVIOUS COLUMN+7 <= END DATE, PREVIOUS COLUMN+7,""),""

    as a part of conditional formatting to hide the #VALUE!, but the #VALUE! still keeps popping up. Any advice?

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)