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 49. Total comments: 4557

  1. 1st set of data Input data Result data
    1 4 1 4 6 1 9 1
    2 6 3 2 3
    9 9 4 9
    4 6
    I have the data in 3 columns,named as "first set of data". If I enter the secondary data called as "input data" How I can design the formula to get the result data according to mentioned in result data? Any body can help me please.

    1. Hello!
      I’m sorry but your task is not entirely clear to me. 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.
      It’ll help me understand it better and find a solution for you. Thank you.

  2. Hi;
    I need some advise for this situation :
    Any advise how would the formula looks like for multiple conditions
    Conditions:
    IF number<=5,and size <= 10 return "Small"
    IF number<=10,and size <= 10 return "Upsize"
    IF number<=10,and size <= 20 return "Upsize"
    IF number<=15 and size <= 30 return "Large"
    IF number= 30 return "Upsize"
    IF number= 30 return "Upsize"

    1. Hello!
      The article above details how to use IF nested functions.
      You can use something like this

      =IF(AND(A1<=5,B1<=10),"Small", IF(AND(A1<=10,B1<=10),"Up", IF(AND(A1<=10,B1<=20),"Up", IF(AND(A1<=15,B1<=30),"large", IF(A1=30,"Up","")))))

  3. Hello Sir,

    I need you help for below situation:

    In column A there are Fruit names, in column B Purchase dates, in column C values are Open or Closed and in Column D Today's date is mentioned. Please help me generate a formula so that it meets below condition:
    If Fruit names are either Apple, Mango or Grapes and if Purchase dates is less than Today's date and in column C value is Open, then result should be 1 else 0.
    Thanks,
    Klywin

    1. Hello Klywin!
      If you apply the IF function to many conditions, the formula will be very large and complex. I recommend using this formula:

      =SUM(IF(A1={"Apple","Mango","Gapes"},1,0)) * (--(B1<TODAY()) * (--(C1="Open")))

      I hope this will help, otherwise please do not hesitate to contact me anytime.

  4. i am unable to merge two formulas
    =IF(F2<=1000,IF(G2=1,2499,IF(F21000,F2<=1800),IF(G2=1,2999,IF(G2=2,1999,"Invalid detail")))
    if i write this formula in one column then it only gives result of first formula condition.

    1. Hello!
      I’m sorry but your task is not entirely clear to me. 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 problem or error occurred. The formula you wrote is incorrect. This may be a copy error. Give an example of the source data and the expected result.
      It’ll help me understand it better and find a solution for you. Thank you.

  5. If Column A has 3 same values i.e 1,1,1 and column B has three different values i.e A,B,C and column C also have three different values P,Q,R so column D should display only Values which are available for A in column C i.e P.

    A B C D(Formula)
    1 A P P
    1 B Q P
    1 C R P
    2 A L L
    2 B M L
    2 C N L

    1. Hello Sir,

      Need your help to create formula for this.

  6. Dear Alexander
    please help me with this.
    I need a formula that can return the highest value in a group of Data.
    let say
    A1=D-300 B1=1 C1=1
    A2=D-300 B2=1 C2=2
    A3=D-300 B3=2 C3=1
    I need a formula that can take into consideration the value in column A and B (even if column A has the same value and column B has different value) and return the highest value in column C. Such that the result will read
    D-300 FOR 1 = 2
    D-300 FOR 2 = 1

    1. I did not quite understand what result you want to get (number, text, or something else). But I think that this formula will be useful.
      To find the value in column A that matches the maximum value in column B, use the formula

      =INDEX(A1:A37,MATCH(MAX(B1:B37),B1:B37,0))

  7. Dear All,
    I require to find three successive cell data A, WO, A in multiple rows in a single page.Then I have to replace any cell data of my choice based on the condition met.
    For eg. the following shows multiple successive cell data present in a sheet.
    P A WO A
    If successive cells are A WO A respectively, then I Have to replace "WO" with "A"

    Please solution

    1. Hello!
      If I understand you correctly, some values are written in several cells. You want to change some of them using a formula with the IF function. But an Excel formula can only change the value of the cell in which it is written. In your case, you need to use VBA.

  8. I have product names in multiple columns and marked the customer name and quantity they ordered in rows. Now I want a different sheet with customer name, quantity and name of product customer ordered. is there a formula to bring the name and quantity of the product customer ordered in columns if the quantity is >= to 0.5.
    I have used IF formula and it works for just one column. How do I go about giving multiple commands to have the result as in below in one cell?
    2 Apples, 1 Orange, 5 mangoes

  9. =IF((AND(I13=,I22=0,I29=0,I30=0),"0.00%",SUM(I13:I35)/SUM(K13:K35)))
    is this possible?

    1. Hello!
      Perhaps you wanted to write down the formula

      =IF(AND(I13=0,I22=0,I29=0,I30=0),"0.00%", SUM(I13:I35)/SUM(K13:K35))

  10. I have a multi-layer problem set, if anyone can help.
    This is a data of around 50k Rows. So i have 2 rows. Row A contains item ordered, Row B has timestamps. If i want to calculate the item wise time gaps, how do i go about it? So for example:
    Row A: Row B:
    Dell Laptop 11:23:04
    Mouse 11:39:00
    Snickers 12:45:01
    Dell Laptop 12:49:08
    Dell Laptop 12:51:46
    Mouse 12:45:00

    I need Row C to show time difference between the next sale of Dell Laptop and first sale, time gap between then third sale of Dell Laptop and second sale.Same goes with Mouse, Snickers, etc
    so Row C1 should ideally be (12:49:08-11:23:04) = 01:26:04
    C2 (12:45:00-11:39:00) = 01:06:00
    and so on. The gaps should calculate only time difference of items sold for only those particular items.

    Complicated for me. Would appreciate the help thanks.

    1. Hello!
      If in your table the first row is the heading, column A contains the goods, column B contains the time of sale, then in cell C2 write down the formula

      =IF(INDEX($B$1:B1, LARGE(IF($A$1:A1=A2,ROW($A$1:A1),1),1))=0,"", B2-INDEX($B$1:B1,LARGE(IF($A$1:A1=A2,ROW($A$1:A1),1),1)))

      I hope this will help, otherwise please do not hesitate to contact me anytime.

  11. Hello,
    Sorry.I need a formula to calculate incentive on sale.
    Creiteria - if sale(D3) is less than 1.51L the incentive is 0. if the sale is above 1.51L the incentive is equal to same figure in % (1.51%), if the sale is 1.52L then the incentive is 1.52%, it continues up to 4.99L same percentage (4.99%) and above 5L the incentive is 5% flat.
    Please do the needful.
    Thank you

  12. Hello,
    I need a formula to calculate incentive on sale.
    Creiteria - if sale(D3) is less than 1.51L the incentive is equal to same figure in % (1.51%), if the sale is 1.52L then the incentive is 1.52%, up to 4.99L same percentage (4.99%) and above 5L the incentive is 5% flat.
    Please do the needful.
    Thank you

  13. Hello Alexander,
    You give great hacks. Please guide me in one condition.
    I want to mark special present (CV) to 2000 employee for 1-17 May 2020. However, in the excel sheet there might be already P (Present), or Y (Half Day) status for employee and remaining cells as blank. I want to ensure that i give maximum 14 CV attendance in blank cells. Rest cells with value "P" and "Y" to remain unchanged. Please guide. I have made the below formula:
    =IF(OR(D1="P",D1="Y",D1="R"),D1,"PL")
    However, i am not able to stop formula from giving CV beyond 14 times.
    Please guide.
    Thanks in advance.

    1. Hello Ankur!
      I’m sorry but your task is not entirely clear to me.
      For me to be able to help you better, please describe your task in more detail. There is no CV in your formula. Do you want to record CV no more than 14 times in the cells for your employees? Then you need to use the COUNTIF function. Please let me know in more detail what you were trying to find, what formula you used and what problem or error occurred. In that case I will try to help you.

      1. My Bad. Let me again explain my question to you:
        I want to mark special present (CV) to 2000 employee for 1-17 May 2020. Out of these 2000 employees many might have worked also and might have got the real attendance. However, in the attendance (excel) sheet there might be cells with P (Present), R (Rest) or Y (Half Day) status for employee and remaining cells as blank (Absent). I want to ensure that i give maximum 14 CV attendance in blank cells (from B1 to R1). Rest cells with value "P", "Y" & "R" to remain unchanged. Please guide. I have made the below formula:
        =IF(OR(D1="P",D1="Y",D1="R"),D1,"CV")
        However, i am not able to stop formula from giving CV beyond 14 times.
        Please guide.

        1. Hello!
          You can use the data validation tool to limit the number of CV values. Select the range B1: R1 and use the formula = COUNTIF ($ B1: $ R1, "CV") <15 to check the data.
          You cannot enter your CV more than 14 times.
          Read more about data validation here.
          If you use the formula to automatically fill in the values, then in cell B1 you can write the formula

          =IF(COUNTIF($A1:A1,"CV") < 15,"CV","")

          Then copy it to the right along the line. Not more than 14 CVs will be recorded.

        2. For now, when i am using this formula, the result comes as "CV" for all the blank cells till R2 (that is 17th May). SO the condition of stopping CV after 14 days is not fulfilled. I want to ensure that while using this formula, i do not give "CV" attendance more than 14 times.

          Thanks in advance.

          Regards

  14. Hello All,
    I am trying to get these three conditional "follow up status" from the variables "QA=1 means Followed Up and QA=2 means Not Followed Up" and PZ2=Estimated Follow up Date. But I still can not find the right and correct calculation. So may I get any help for the solution?
    =IF(AND(QA=1, PZ2<"5/31/2020"),"Followed up", IF(AND(QA=2, PZ2"6/1/2020"),"Waiting for follow up")))

    1. Hello All,
      I am trying to get these three conditional "follow up status" from the variables "QA=1 means Followed Up and QA=2 means Not Followed Up" and PZ2=Estimated Follow up Date. But I still can not find the right and correct calculation. So may I get any help for the solution?
      Please ignore the first one.
      =IF(AND(QA=1, PZ2<"5/31/2020"),"Followed up", IF(AND(QA=2, PZ2"6/1/2020"),"Waiting for follow up")))

      1. Hello Dev!
        To check the condition with the date, use the expression PZ2 < DATE (2020,5,31) instead of PZ2 < "5/31/2020"

        In addition, QA cannot be a reference to a cell. Maybe you wanted to write QA1? Or is it a named range?

        I hope this will help, otherwise please do not hesitate to contact me anytime.

        1. Dear Alexander,
          As you suggested I tried adding "DATE" like this but still I couldn't get the right/correct solution. Could you have any next way and right way to solve this one?

          =IF(AND(QA2>0, PZ2<DATE(2020,5,31)),"Followed up", IF(AND(QA2=2, PZ2DATE(2020,6,1)),"Waiting for follow up")))

          Thank you very much!

          1. Dear Dev!
            Your answer is not entirely clear to me. I will try to find a solution, but more information is needed. What is the mistake in your opinion? Give an example of the source data and the expected result. It’ll help me understand it better and find a solution for you.
            I suggest this version of the formula

            =IF(AND(QA2 > 0,PZ2 < DATE(2020,5,31)),"Followed up",IF(AND(QA2=2,PZ2 < DATE(2020,6,1)),"Waiting for follow up","0"))

            Thank you.

            1. Dear Alexander,

              Thank you for your quick responses on my issue. I solved my issue with your reference using the function;
              =IF(AND(ISNUMBER(S2)),"Followed up",IF(AND(QA2=2,PZ2<DATEVALUE("5/31/2020")),"Follow up missing","Waiting for follow up"))

              1. Dear Alexander,

                This the final I used function. Thank you for good responses.
                =IF(AND(QC3=1), "Followed up", IF(AND(QC3=2,QB3<DATEVALUE("5/31/2020")), "Follow up missing", "Waiting for follow up"))

                Happy!!!

          2. Dear Alexander,
            As you suggested I tried adding "DATE" like this but still I couldn't get the right/correct solution. Could you have any next way and right way to solve this one?

            =IF(AND(QA2>0, PZ2<DATE(2020,5,31)),"Followed up", IF(AND(QA2=2, PZ2DATE(2020,6,1)),"Waiting for follow up")))

  15. Hello iam looking for a formula for this, if A1=A2,B1=B2,M1=M2 then it is a "True Duplicate" otherwise "NO" the result "True Duplicate" or "NO" is supposed to show up in both rows

    Please help

    1. Hello Penny!
      Write this formula in the cells in which you want to see messages

      =IF(AND(A1=A2,B1=B2,M1=M2),"True Duplicate","No")

      I hope my advice will help you solve your task.

  16. Hi Again, the previous formula didn't return the needed updated results. So i wondered if i concatenate the ranking (ei. A,B,C,D) with Conus or Oconus. Then i would just need a formula that calculates the below requirements, can you please help?:
    if A1=ACONUS or BCONUS and D1 is anything but 12, return 15
    if A1=CCONUS and D1 is anything but 12, return 12
    if A1=DCONUS and D1 is anything but 12 return 10
    if ACONUS, BCONUS, CCONUS, DCONUS and D1=12, return 17
    if A1= AOCONUS or BOCONUS, return 34
    if A1 = COCONUS or DOCONUS, return 32

  17. Hi, I'm beginner. I have a one query as below posted.
    Q- A builders merchant gives 10% discount on certain product lines.
    The discount is only given on products which are on Special Offer, when the Order Value is $1000 or above.
    [use IF and AND functions]

    Product Special Offer Order Value Discount Total
    Product 1 Yes 1,500 150 1,350
    Product 2 No 1,300 130 1,170
    Product 3 Yes 500 - 500
    Product 4 Yes 2,800 280 2,520
    How formulation i should follow for above case.

    1. Hello Jay!
      If I understand your task correctly, the following formula should work for you

      =IF(AND(B10="Yes",C10*D10>1000), C10*D10*0.9,C10*D10)

      I hope this will help, otherwise please do not hesitate to contact me anytime.

  18. Hello All,

    I am looking for a formula
    if the value is equal or less that one , the it should be calculated the 50%
    something like - IF(K13<=1(K13+K13*50/100)
    And if the value is greater than 1 but less or equal to 5 , then add 40%

    Need both in a single line

    1. Hello!
      The formula below will do the trick for you

      =IF(K13 <= 1,K13*0.5,IF(AND(K13 <= 5,K13 > 1),K13*1.4,K13))

      I hope it’ll be helpful.

  19. I am working on an employee schedule. I have start times that I want to turn into Open, Close on another section of the sheet. I have that working with the =IF(ISNUMBER(SEARCH("8a",B4)),"Open","Close")

    However, I have OFF on some days and I need it to show OFF on the other Section with the Open,Close

    This is the formula I came up with but it gives a Value Error
    =IF(ISNUMBER(SEARCH("8a",B4)),"Open","Close") IF(B4:G13 = "OFF", "OFF", "")

    1. Hello David!
      If I got you right, the formula below will help you with your task

      =IF(ISNUMBER(SEARCH("8a",B4)),"Open", IF(B4="OFF","OFF","Close"))

      I hope this will help, otherwise please do not hesitate to contact me anytime.

      1. That fixed my formula. Thank you

  20. HI! I'm trying to say if B2=sat or sun AND g2=As Scheduled value should be $5 if not $0 so the conditions to get $5 are it has to be sat or sun AND as scheduled
    so far I've tried
    =IF(ISTEXT(B9),"Sat",IF(ISTEXT(B9),"Sun",IF(ISTEXT(G9),"As Scheduled","$5")))
    =IF(AND(B2="Sun",B2="Sat",G2="As Scheduled"),"$5","$0")
    I'm driving my self mad! Hope you can help! Thanks!

    1. Hello Mary!
      If I got you right, the formula below will help you with your task:

      =IF(AND(OR(B2="Sat",B2="Sun"), G2="As Sheduled"),"$5","$0")

      I hope it’ll be helpful.

  21. Hi, I really need some help please.
    I need the end result to be Yes or No.
    For yes, the criteria should be:
    F2 must be greater than 2
    G2 must be False
    S2 must be False
    Q2 must not contain the words Matter Data
    =IF((AND(F2>2,G2="False",S2="False",Q2Matter Data)),"Yes","No")

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

      =IF(AND(F2>2,G2="FALSE",S2="FALSE", NOT(ISNUMBER(FIND("Matter Data",Q2,1)))),"Yes","No")

      Read how to use the IF function with text values here.
      I hope this will help, otherwise please do not hesitate to contact me anytime.

    2. =IF((AND(F2>2,G2="False",S2="False",Q2Matter Data)),"Yes","No")

      ...Sorry, slight typo but still doesn't work :(

  22. Hi i have question regarding multiple condition:How to get system stock May'20 column by applying function IF.please suggest
    example:
    Customer ; Stock to be consumed; Schedule May'20 ;System stock (May'20)
    B 602 560 42
    C 545 YTR −
    D 1 0 1
    E 27 0 27
    G 120 150 30
    H 36 YTR -
    Thanks in advance

    1. Hello!
      You have not specified which system stock you want to receive on May 20 - general or by customer. But in any case, I recommend using the SUMIFS function. Read more in this Excel SUMIFS guide.
      I hope this will help, otherwise please do not hesitate to contact me anytime.

  23. if 1-2 range answer multiplies by 2,500
    3-4 multiplies by 3,000
    5-6 multiplies by 4,500
    what is the formular

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

      =IFERROR(CHOOSE(R1,2500,2500,3000,3000,4500,4500)*Q1,Q1)

      or

      =IF(OR(R1=1,R1=2),Q1*2500,IF(OR(R1=3,R1=4),Q1*3000,IF(OR(R1=5,R1=6),Q1*4500,Q1)))

      Hope this is what you need.

  24. I got help with a formula last month and need to add some additional variables to it. typed at end of my comment is the formula i have so far, but need to also add somewhere into the below "if AJ6 = CONUS AND D6 IS NOT 12, AND I6 IS "D", then return 10 and if I6 is "C", then return 12" everything else below remains the same. I'm not sure if this is even possible.

    =IF(Aj6="Conus",IF(AND(D6=12, SUM(IF(G6={9820580,159384},1,0))=1),17, IF(OR(D6 < 12,AND(D6=12,G6=6620363)),15,"")), IF(AJ6="Oconus",28,""))

    1. Hello Jessica!
      Replace the "" symbol in your formula

      =IF(AH1="Conus", IF(AND(D1=12,SUM(IF(G1={9820580,159384},1,0))=1),17, IF(OR(D1 < 12,AND(D1=12,G1=6620363)),15,"")), IF(AH1="Oconus",28,""))

      with these conditions:

      =IF(AND(AJ6="Conus",D6<>12,I6="D"), 10,IF(I6="C",12,""))

      The result is a new formula:

      =IF(AH1="Conus", IF(AND(D1=12,SUM(IF(G1={9820580,159384},1,0))=1),17, IF(OR(D1 < 12,AND(D1=12,G1=6620363)),15,"")), IF(AH1="Oconus",28,IF(AND(AJ6="Conus",D6<>12,I6="D"),10, IF(I6="C",12,""))
      ))

      I hope it’ll be helpful.

      1. That didn't work :( "C" and "D" values in column I for CONUS are still returning 15 instead of 12 and 10

        1. what if i concatenate the ranking (ei. A,B,C,D) with Conus or Oconus. Then i would just need a formula that says:
          if A1=ACONUS or BCONUS and D1 is anything but 12, return 15
          if A1=CCONUS and D1 is anything but 12, return 12
          if A1=DCONUS and D1 is anything but 12 return 10
          if ACONUS, BCONUS, CCONUS, DCONUS and D1=12, return 17
          if A1= AOCONUS or BOCONUS, return 34
          if A1 = COCONUS or DOCONUS, return 32

  25. Hi,
    I'm having a problem with writing the formula for the following with 3 conditions:
    -if column A says yes , and the value in column B=80 then I need to multiply Value in B by 0.30
    if column A says no , then I need to multiply Value in B by 0.45
    Your help will be much appreciated

    1. Hello Aneta,
      Please try the following formula:

      =IF(AND(A1="Yes",B1=80), B1*0.3,IF(A1="No",B1*0.45,B1))

      I hope it’ll be helpful.

      1. hi ,
        Thank you, that's amazing it works , I have one last question.
        I need to write the formula for the following but the one I did below it does not work:
        =IFS(AND(G9="yes",F9=80),F9*0.3),IF(G9="no",F9*0.45)

        Here are 3 conditions:
        1.IF G9 says yes and F9=80, theN multiply F9*0.30
        3.if G9 says no, then multiply F9 * 0.45
        Your help would be much appreciated. Thank you Alexander

        1. Hello Aneta!
          Why are you asking the same question twice? Just change the cell addresses in the formula above.

          1. Sorry, I'm not sure what happened there, I have one extra condition to enter
            IF G9 says yes and F9 I greater or equal to 80 , then I need to multiply F9*0.30, if G9 says yes and F9 is lower than 80 then multiply F9* 0.15, if G9 says yes then multiply F9 by 0.45

  26. My goal is to know when to Water my lawn. I am trying to nest and or in an if function.
    So on even days if the week day is Monday, Tuesday Friday or Saturday then I water.
    I got the formula to work but on August first - - it switched to odd days.
    this is the formula I used in the first cell for June 1st =IF(AND(OR(WEEKDAY(A1,1)=2,WEEKDAY(A1,1)=3,WEEKDAY(A1,1)=6,WEEKDAY(A1,1)=7), AND(MOD(A1,2)=0)), "Water", " ") --- Where did I go wrong?
    6/1 Monday
    6/2 Tuesday Water
    6/3 Wednesday
    6/4 Thursday
    6/5 Friday
    6/6 Saturday Water
    6/7 Sunday
    6/8 Monday Water
    6/9 Tuesday
    6/10 Wednesday
    6/11 Thursday
    6/12 Friday Water
    6/13 Saturday
    6/14 Sunday
    6/15 Monday
    6/16 Tuesday Water
    6/17 Wednesday
    6/18 Thursday
    6/19 Friday
    6/20 Saturday Water
    6/21 Sunday
    6/22 Monday Water
    6/23 Tuesday
    6/24 Wednesday
    6/25 Thursday
    6/26 Friday Water
    6/27 Saturday
    6/28 Sunday
    6/29 Monday

  27. how can i make a formula using grading system (5,4,3,2,1) in date submission

    5 for earlier than due date by 2 or more days
    4 for earlier than due date by 1 day
    3 for due date
    2 for later than due date by 1 day
    1 for later than due date by 2 or more days

    1. this is my sample formula i made, but seems not to get the grade 2 or somethings wrong i think, pls help

      =IF(H17<=F17-2,"5",IF(H17F17,"2",IF(H17>=F17,"1")))))

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

        =IF((F17-H17) >=2,5,IF((F17-H17) >=1,4,IF(F17=H17,3, IF((F17-H17)>-2,2,1))))

        Hope this is what you need.

  28. in excel formula if a1 is between 1 to 5 then multiple 2.5 and if A1 is between 6 to 9 then multiply from 2

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

      =IF(AND(A1 > 1,A1 < 5),A1*2.5,IF(AND(A1 > 6,A1 < 9),A1*2,A1))

      I hope it’ll be helpful.

      1. Dear Alex,
        Thank you so much. It answered my question and its perfectly working.

  29. Hello,
    Looking to use conditional formatting to turn a row Green if the word "TEST" is in any cell in that row twice
    Row should turn RED if the word test is only there once

    Thank You!

    1. Meaning, two cells in that row contain the word TEST

  30. I'm so stuck!! I'm as blank as the sky !!

    if A3 has "New" and B3 has "CT" then put value of H3 in Cell? ... But with the drop down I need
    if A3 has "New" and B3 has "SUS" then put value of H4 in Cell?

    This Is probably simple but i'm tired but need it :( Thank guys n Girls :)

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

      =IF(AND(A3="New",B3="CT"),H3, IF(AND(A3="New",B3="SYS"),H4,0))

      I hope this will help, otherwise please do not hesitate to contact me anytime.

      1. Hello devid,
        I am trying to calculate a cell is eligible or not .like if a cell contain yes,or date then and then he is eligible otherwise no..how to create formula

  31. Need help with a formula !
    My cell contains the following value (95% Cotton, 5% Elastane)
    I need to set a condition that if my cell has the value "cotton" and the percentage before the string(cotton) is >= 50% it should return true if not it should return false.
    Here are a few samples of how the values could be populated.

    90% Cotton, 8% Polyamide, 2% Elastane
    95% Baumwolle (Bio), 5% Elasthan
    90% Cotton, 8% Polyamide, 2% Elastane

    In whatever scenario if the cell has value with "cotton" in it and the value before the string is >= 50% , it should return true.

    Thank you

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

      =IF(IFERROR(IFERROR(MID(A10,SEARCH("Cotton",A10,1)-4,2), MID(A10,SEARCH("Cotton",A10,1)-3,1)),0) >= 50,TRUE,FALSE)

      I hope this will help, otherwise please do not hesitate to contact me anytime.

  32. If month is 202005 or 202006, and staus is hiring, then vlookup based on business name else 0
    if(or('Org moves'!CO2=202005,'Org moves'!CO2202006) And('Org moves'!CP2="Hiring"),vlookup(Walk!B7,'Org moves'!AB:CQ,68,0),"0")
    i used this. please help resolving error

    1. Hello!
      I could not check your formula on real data. Try this formula

      =IF(AND(OR('Org moves'!CO2=202005,'Org moves'!CO2=202006), ('Org moves'!CP2="Hiring")), VLOOKUP(B7,'Org moves'!AB:CQ,68,0),"0")

      I hope this will help, otherwise please do not hesitate to contact me anytime.

  33. Could you help with this data validation custom formula? This formula works:
    =OR(D10="X", D10="B") but when I add an additional condition, it doesn't work. My new conditions are:
    CONDITION 1: D10="X" OR
    CONDITION 2: D10="B" AND E10="55"
    I have tried several combinations of OR and AND formula including the sample here on the this website but none works for me. I appreciate your help. Thank you very much.

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

      =IF(OR(D10="X", AND(D10="B",E10=55) ),TRUE,FALSE)

      I hope this will help, otherwise please do not hesitate to contact me anytime.

      1. Hi Alexander,
        It works! I just removed the IF function as my condition needs to be always true to allow data entry in another cell. Thank you very much!

  34. IF(OR(D7="N/A", AND(D7="0", F7="Yes")), "0","1")
    I need the value of this formula to be 0 if, either the value of D7 is N/A or if the value of D7=0 AND F7 is Yes.

    Am I using the correct formula for this condition?

    1. Hello Sanjay!
      The formula is spelled correctly. However, if you do not write numbers as text, then you do not need to use quotation marks.

      =IF(OR(D7="N/A", AND(D7=0, F7="Yes")), 0,1)

      1. Thanks Alexander Trifuntov.
        It worked. I spent a lot of time on this and finally your suggestion did the trick.
        Appreciate the quick turnaround.

  35. =IF(OR(AND(AA2="Canada",Z2="Vancouver"),K2=1,k2=9),M2*5,M2=M2)
    how do i solve the problem below using the nested OR & AND function
    Increment the backers-count by 5 if:
    The launched_at_month is January OR September
    The city is Vancouver AND the country_trimmed is Canada
    If these conditions are not met, the backers-count stays the same.

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

      =IF(AND(AA2="Canada",Z2="Vancouver", OR(K2=1,K2=9)),M2*5,M2)

      I hope it’ll be helpful.

  36. lets says =IF(AND(R4>S4,S4>T4,T4>U4,U4>V4,V4>W4,W4>X4),"UP&DOWN",IF(AND(R4<S4,S4<T4,T4<U4,U4<V4,V4<W4,W4<X4),"PASS","NOT GROWN"))
    up&down cannot be used idk why,the circumstance was r4 to w4 just one of them going down its gonna say up&down
    please help

    1. Hello!
      Please describe your problem in more detail. It’ll help me understand it better and find a solution for you. Thank you.

  37. Need help with formula

    if D3=x,v4>120,"RED", "YELLOW"),If D4="Active", "BLANK")
    trying to day if D3 = Active and V4 Greater than 120 then RED otherwise Yellow. But if D3 is not equal to Active then leave it blank.
    Thanks
    Anna

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

      =IF(AND(D3="Active",V4 > 120),"RED", IF(D3 <> "Active","","YELLOW"))

      I hope it’ll be helpful.

  38. not sure why, but the post is not displaying the entire formula as I am pasting it,

    =IF(AND(B25>A15,B25A16,B25A17,B25A18,B25A19,B25A20,B25*C16)

  39. updated but still not correct

    =IF(AND(B25>A15,B25A16,B25A17,B25A18,B25A19,B25A20,B25*C16)

    1. Hello Keith!
      Please describe your problem in more detail. The IFOR function does not exist. What does the B25A16 mean? It’ll help me understand it better and find a solution for you. Thank you.

    2. =IF(AND(B25>A15,B25A16,B25A17,B25A18,B25A19,B25A20,B25*C16)

  40. I am trying to compare a sales amount in a cell to a commission schedule and based on teh sales figure it will bring multiply the sales times the correct commission %. I know this is not correct but I am not sure where I am going wrong

    =IFOR((AND(B25>A15,B25A16,B25A17,B25A18,B25A19,B25A20,B25*C16)

  41. Hello,
    Just want to say thank you , you doing great job, lord shower grace on you.
    I was writing my problen but suddenly answer clicked, thank you again.
    Thank you so much!

  42. Hi,
    I'm trying to write an "If" statement if 3 variables in different cells match up with each other then "Y" else "N"

    If [A2]=[C2]=[D2]THEN "Y" ELSE "N" ENDIF

    1. Hello Michelle!
      Please try the following formula

      =IF(A2=B2,IF(B2=C2,"Y","N"),"N")

      I hope it’ll be helpful.

  43. I'm stuck, wonder if someone can help me:
    I need ranges-
    if cell value is =1500 and =3000 and =5000 "5000+"

    I know it's where I'm putting the () but I can't seem to get it right?

    1. Hello Cindy!
      I’m sorry but your task is not entirely clear to me. I hope you have studied the recommendations in the above tutorial. For me to be able to help you better, please specify which formula you mean and describe the problem in more detail. Thank you.

      1. sorry, it didn't type out correctly
        If h2 is less than 1500, then "<1500", if h2 is greater than or equal to 1500 AND less than 3000, then "1500-2999", if h2 is greather than or equal to 3000 AND less than 5000, then "3000-4999", if h2 is greater than 5000, then "5000+"

        1. Hello Cindy!
          Please try the following formula:

          =IF(D2 < 1500,"<1500", IF(D2 < 3000,"1500-2999",IF(D2 < 5000,"3000-4999", "5000+" ) ) )

          The second way:
          Write your values in columns A, B, C. A1 - 0 B1 - 1499 C1 - <1500 A2 - 1500 B2 - 2999 C2 - 1500-2999, etc. If the final value is written in D1, then the formula for determining the output will be as follows:

          = VLOOKUP (D1, A1: C4,3,1)

          I hope this will help, otherwise please do not hesitate to contact me anytime.

  44. Hello,
    I'm hoping to add a calculated field to my pivot table and need a little help.
    A B C calc field
    1 "A only"
    1 1 "A & B"
    1 "C only"
    1 "B only"
    1 1 1 "All 3"
    1 1 "B & C"
    1 1 "A & C"

  45. Hello, how do write a formula for this? If total is between .01%-.99%, output should be $40, if between 1% and 1.99% - output should be $210. I tried IF and also IF(AND with , but I can't get it to work...help please. Thank you so much!
    0.01% ---> 0.99% $40.00
    1% ---> 1.99% 210.00
    2% ---> 2.99% 240.00
    3% ---> 3.99% 270.00
    4% ---> 4.99% 300.00
    5% ---> 5.99% 330.00
    6% ---> 6.99% 370.00
    7% ---> 7.99% 410.00
    8% ---> 8.99% 450.00
    9% ---> 9.99% 490.00
    10% ---> 10.99% 540.00
    11% ---> 11.99% 590.00
    12% ---> 12.99% 640.00
    13% ---> 13.99% 690.00
    14% ---> 14.99% 740.00

    1. hello Phatima!
      Write your values in columns A, B, C. A1 - 0.01% B1 - 0.99% C1 - 40.00, etc. If the final value is written in F1, then the formula for determining the output will be as follows:

      =VLOOKUP(F1,A1:C15,3,1)

      I hope this will help, otherwise please do not hesitate to contact me anytime.

  46. Hi,
    Great article!
    In my example below, is it possible to add to the formula so that results in column 'C' would also take into consideration the value in column 'B' and (subtract 10 if 'B'=1) or (subtract 20 if 'B'=2)
    Hope this makes sense, thank you!
    A B C
    1 35 1 150
    2 33 150
    3 40 2 200
    4 41 200

    =ifs(and(A1>=30,A1=38,A1<42),200)

    1. Hello!
      Your formula does not work. I did not understand what result you want to get. If there are already numbers in column C, then they cannot be changed by the Excel formula. Please describe your problem in more detail. It’ll help me understand it better and find a solution for you. Thank you.

      1. thanks for the response.
        I didn't realize I pasted wrong the formula
        here is the correct one I use:
        =ifs(and(A1>=30,A1=38,A1=" and "<") from Column 'A' which are size values. Now I want to add additional criteria (Column 'B') which is a quality grade (A,B,C or can be switched to numbers 1,2,3) so the calculated value (price) in column 'C' would be less by 10 if 'B=1', less by 20 if 'B=2', less by 30 if 'B=3', if 'B=blank' leave it as it is.
        Hope this makes sense and thank you for all your help!
        Alex

        1. ifs(and(A1>=30,A1=38,A1<42),200)

          1. I'll put it in words:
            if "A1" is "greater than or equal to" 30 and "less" than 38, than 150, if "A1" is "greater than or equal to" 38 and "less" than 42, than 200
            hope this makes sense as it won't let me paste the formula in the chat correctly.

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

              =IF(B1<>"", (IF(AND(A1>=30,A1<38),150, IF(AND(A1>=38,A1<42),200,""))) - (B1*10), IF(AND(A1>=30,A1<38),150, IF(AND(A1>=38,A1<42),200,"")))

              I hope this will help, otherwise please do not hesitate to contact me anytime.

              1. Yes! That's it!
                Thank you sooooo much!
                Appreciate all your help!

          2. ifs(and(A1>=30,A1<38)=38,A1<42),200)

          3. ...Never mind, the forum messages will change the formula every time I submit it.

        2. ...here it is again, for some reason when I publish the comment it changes the formula pasted.
          I'll try again with no "=" sign
          ifs(and(A1>=30,A1=38,A1<42),200)

  47. Hi,

    I order supplies for my company and have created a sheet that has 13 tabs, one for each 4 week period and a Summary tab at the end. On each tab I have:

    ItemOrdered Qty Item# Supplier Cost$ DateOrdered DateReceived QTY/CS

    I need to create a formula where IF a certain item is ordered (say triggered by Item#), THEN, the value in the Qty column is tallied as a sum on my Summary tab. Does that make sense?

    Thanks in advance!
    Matt

  48. Hello,
    I need the following formula:
    if in column A I have the word "Revision", I need to put it in column B but not at same level (-1 level).
    Exemple: if A4=Revision: 2.1--> put all content in B3

    Thank you very much

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

      =IF(SEARCH("Revision",A4,1)>0,A4,"")

      If there is anything else I can help you with, please let me know.

  49. if the 1st row is greater than the other row then the answer is 1
    if the 1st row is lesser than the other row then the answer is 0
    if the 1st row is 0 than the other row is 0 then the answer is 1
    if the 1st row is equivalent to the other row then the answer is 0

    1. Hello Vincent!
      I’m sorry but your task is not entirely clear to me. Do you want to compare rows or cells? What does "row is greater than the other row" mean? Could you please describe it in more detail? Thank you!

  50. I am trying to work out an IF formula for the following. I have a spreadsheet that details stock and whether it is in date, out of date or expiring soon. I need the cell to show whether an item expires one month from today, is in date or out of date. I am struggling to work out the IF formula - this is what I have come up with so far, but am unable to get any further. Any help would be greatly appreciated by this newbee to Excel

    =IF(E3<TODAY()*AND(-365-335),"Exp 1 mth",IF(E3<TODAY()-365,"Out of date","In date"))

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

      =IF(E3>TODAY(),"In date",IF(E3 > EDATE(E3,1),"Exp 1 mth","Out of date"))

      I hope this will help, otherwise please do not hesitate to contact me anytime.

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