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 9. Total comments: 2538

  1. Hi I'm having trouble writing a formula, where if there's a date entered in cell AG2 for the text "Closed" to be entered automatically, and the same for AD2 and E2, but with differing text. Otherwise to leave the cell empty.
    But I can't seem to get it to work, as it returns an empty cell, even though there's dates in these cells.
    However for some reason, if I take the asterisk out of the quotations it'll enter the text for the cell without anything in (which shows it does kind of work, just not the way I want it to). I'm probably doing something wrong here, could you have a look and adjust it if possible?

    =IF(AG2="*","Closed",IF(AD2="*","Awaiting Sign Off",IF(E2="*","Open","")))

    Thank you

    1. Hello!
      Please try the following formula:

      =IF(AG2<>"","Closed",IF(AD2<>"","Awaiting Sign Off",IF(E2<>"","Open","")))

      I hope it’ll be helpful.

      1. Works perfectly. Thank you for the fast response.

  2. Is it possible to create an IF formula that writes different results (separated with a comma) in the same cell? for example, let's say
    A2 = #10 031
    A4 = #15 213
    A1= 0
    A4= 0
    If A1 is equal to "1" do not write anything but if A1 is equal to "0" then result is equal to A2
    If A3 is equal to "1" do not write anything but if A1 is equal to "0" then result is equal to A4
    If.... continues

    then the formula should write in the same cell =
    #10 031, 15 213

    I don't know if I am making myself clear xD, any master out there who knows if its possible?

      1. oh :c
        I will try to work around that,
        thanks a lot, you saved me a lot of time.

    1. My bad
      A2 = #10 031
      A4 = #15 213
      A1= 0
      A3= 0

  3. I am looking to solve this formula - where X is a variable (% performance)
    IF(X80100150,550000)))))

    what am I doing wrong?

    1. Sorry this was captured wrongly. Here are the conditions:

      % performance Award
      150% 550,000.00
      >100%80%<100% 250,000.00
      <80% -

  4. I need help to get an appropriate formula for my table.
    The table headers have A remark(Suppressed, Unsuppressed), B indicator(Routine, Targeted), C (Date of Result), and D (Next due date)
    I want the following to happen,
    1) If (A2) is Suppressed and (B2) is Routine, (D2) should add 11 months from (C2) date.
    2) If (A2) is Suppressed and (B2) is Targeted, (D2) should add 5months from (C2) date.
    3) if (A2) is suppressed and (B2) is either Routine or Targeted, (D2) should add 3months from (C2) date.

      1. Thank you, Alexander. You are a genius. This is the modification I made from the formula you gave me
        =IF(A2="SUPPRESSED", IF(B2=TARGETED", DATE(YEAR(C2), MONTH(C2)+5,DAY(C2)), IF(L6="SUPPRESSED", IF(B2="ROUTINE", DATE(YEAR(C2), MONTH(C2)+11,DAY(C2))), C2))).
        It works. However, my No 3 condition should be (A2) is "unsuppressed" and (B2) routine or targeted.

        1. Hi!
          If condition 3 is satisfied, then conditions 1 and 2 are satisfied. You cannot perform 3 actions at once.

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

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

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

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

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

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

            1. 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)*(F1<A1:A12+C1:C12),0)),"")

              Please check out this 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

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

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

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

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

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

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

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

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

      1. Thanks so much!!

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

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

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

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

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

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

        1. Hi!
          Try the following formula:

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

          This is Vlookup for approximate match

  13. 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!

    1. 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”))

      1. thank you so much!!! it works :)

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

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

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

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

      1. That worked! Thank you so much!

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

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

    2. 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!

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

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

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

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

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

  21. 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$

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

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

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

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

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

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

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

      1. Thank you so much it worked very well

  26. 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?

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

      1. I got it.. thank you?

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

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

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

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

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

  30. 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!

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

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

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

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

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

  33. 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!

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

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

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

  34. If cell C2 is greater than 50000, then give 20% discount, if less than 50000 give nil discount. Please assist me with the correct IF Function

  35. I required a formula

    Name factory Name invoice type Qty
    A Rawal Plant GST 478
    B AJK Plant without GST 325
    C Rawal Plant without GST 843
    D AJK Plant GST 275
    E AJK Plant GST 564
    F Rawal Plant without GST 528
    G AJK Plant without GST 362
    H AJK Plant GST 358

    Required data separately Qty
    AJK Plant GST ?
    AJK Plant without GST ?
    Rawal Plant GST ?
    Rawal Plant without GST ?

  36. I know how to reference cells on other sheets, but I'd trying to point to a cell on another sheet IF the date at the beginning matches the date I input.

    For example: I have dates running down the A column on Sheet1, and total sales running down the B column also on Sheet1.

    On Sheet2, I'd like to enter a date into A1 and, on A2, I'd like it to tell me the total for that day, as already listed on Sheet1.

    ---

    Sheet1:
    Dates:
    A1 - 01/04/21
    A2 - 02/04/21
    A3 - 03/04/21
    etc.

    Total sales:
    B1 - 7
    B2 - 4
    B3 - 8
    etc.

    ---

    Sheet 1:
    B:B - I can input the total sales for the day in A:A

    Sheet 2:
    A1 - I can input any date.
    A2 - show me the total sales for that date.

    ---

    I've tried using =IF on Sheet2 and manually nesting formulas for each cell in each row I want to reference on Sheet1, instance by instance.
    Eventually, I'd end up nesting over 100 formulas in a single cell on Sheet2.

    Is there a way to do this more generally?

    1. Hello!
      If I understood the problem correctly, the SUMIF function can be used in cell A2. You can learn more about SUMIF in Excel in this article on our blog.
      I hope my advice will help you solve your task.

      1. Hi Alexander,

        That's exactly what I needed. Perfect! Thanks for that :)

  37. I have to use single cell as a condition for the whole column.. How can i use it?

    For example in the below formula i have to use cell Formula!A2 for all the cells in the column W in the workings spreadsheet.

    =IF(Workings!W2=Formula!A2,CONCATENATE("V2",".",A3),CONCATENATE("I2",".",A3))

  38. Hello,

    Needing some help with a formula that will produce my values that might have a letter at the end of it. IE.

    =IFERROR(IF(OR(VALUE(B90)7000),"",VALUE(B90)),"") this works perfectly fine when I am doing only numbers like 1000 or 4000, but when I have a 3429G, this formula will obviously leave my cell blank. I need to get my cells that might have inventory letters and numbers together to post in that cell. Is there a formula to help identify if there is text within numbers?

    1. Hi,
      If there are no letters in a cell, it can be converted to a number. If this is not possible, then there are letters in the cell.
      For example:

      =IF(ISNUMBER(--(B1)),"Number","Text")

      I hope my advice will help you solve your task.

    2. Sorry it messed the formula up for some reason. Here is my current formula:

      =IFERROR(IF(OR(VALUE(B86)7000),"",VALUE(B86)),"")

  39. Good Day! Need assist!
    I have a formula: =IF(I2>64,IF(J2<=$O$20,TRUE),IF(I2$O$20,TRUE),IF(I2>64,IF(J2>$O$20,FALSE),IF(I2<64,IF(J2<=$O$20,FALSE)))))
    O20 is a particular criteria near the table that I am changing.
    Currently I am receiving everything correctly, where True is that my system results (column J) predicted the results from column I and False appears when the system provided a wrong result. However, there is an exception that I need to add IF(I2<64,IF(J2<=$O$20,FALSE) I want to see in this case in the cell "EXCEP"
    Please, comment if I do not described the question correctly?

    1. Hello!
      Try the following formula:

      =IF(I2>64,IF(J2<=$O$20,TRUE,
      IF(I2<$O$20,TRUE,
      IF(I2>64,IF(J2>$O$20,FALSE,
      IF(I2<64,IF(J2<=$O$20,FALSE)))))),IF(J2<=$O$20,FALSE))

      I'm not sure if this will work. There is already a condition IF(I2<64 in your formula.
      I can’t check the formula, because I don’t know the conditions and I don’t have the source data.

  40. HELLO i need help please.

    i need a formula that says
    if in a cell there is the word- red then return a 3 if it says blue then return a 2 and if yellow then return a 1

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

      =IF(ISNUMBER(SEARCH("red",B1,1)),3, IF(ISNUMBER(SEARCH("blue",B1,1)),2, IF(ISNUMBER(SEARCH("yellow",B1,1)),1,"")))

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

  41. Hello to all,
    I really need your help about this formula. I've tried everything I know about excel...

    When I use this formula to check the field A30 (could be a date OR text Always On):
    =IF(OR(A30="Always On";A30>=TODAY());"ACTIVE";"NOT ACTIVE")
    If I put a date in A30, the result is correct, ACTIVE if higher or NOT ACTIVE if lower.
    But with any text in A30, it gives me always ACTIVE, instead of only recognizing Always On.

    I have tested the same formula but choosing different fields (A30 and B30):
    =IF(OR(A30="Always On";B30>=TODAY());"ACTIVE";"NOT ACTIVE")
    And in this case, it recognize either the date AND the correct or wrong text.

    Do you know why it is happening when it is the same field?

    Thank you for your help!

    1. Hello!
      Add a condition to the formula: if the date is checked, then A30 must be a number.

      =IF(OR(A30="Always On",AND(ISNUMBER(A30),A30>=TODAY())), "ACTIVE","NOT ACTIVE")

      I hope it’ll be helpful.

  42. Hi,

    I'm newbie to excel, I hope you could help me, basically I'm trying to get the formula if two conditions are met
    example: If A1="apple" and A4 contains %(eg.12345%Mango), then it will sum the C1/B4 and do nothing if not.

    Appreciate your response.

    1. Hello!
      What does the “sum the C1/B4” phrase mean?
      This formula shows the fulfillment of your conditions.

      =IF(AND(A1="apple",ISNUMBER(SEARCH("%",A4,1))),"Yes","No")

      You can write other values or formulas instead of Yes and No.

  43. Hi How would i set up formatting? using an If statement for example
    if A1:A3 = yes color whole row green (A1:BE1)

    thank you in advance!

  44. Hello!

    Trying to figure out how to do if statements to add up to a number between 1 and 4 if they hit certain if statements and then have that number multiple by 200

    If( B1>=A1,0,1) + ( If B2>=A2,0,1) + (B3>=A3,0,1) + (B4>=B4,0,1) .....Then depending on how many 1's that adds up to that sum would be multiplied by 200

    1. Hello!
      If I understand you correctly, then you can use any of these formulas:

      =(SUM(IF(B1>=A1,0,1),IF(B2>=A2,0,1),IF(B3>=A3,0,1),IF(B4>=B4,0,1)))*200

      =(SUM(--(B1<A1),--(B2<A2),--(B3<A3),--(B4<B4)))*200

      =((B1<A1)+(B2<A2)+(B3<A3)+(B4<B4))*200

      Hope this is what you need.

  45. cell A1 can have value "ok", "nok", or "n/a".
    same cell B1 can have value "ok", "nok", or "n/a".

    How can I in cell C1 return:

    ok if both A1andB1 are ok.
    nok if either is nok.
    ok if A1orB1 is ok and the other is n/a.
    n/a if both are n/a.

    Below formula returns all except n/a.

    =IF(OR(AND(DD3527="ok", DR3527="ok"),AND(DD3527="n/a",DR3527="n/a")), "ok", "nok")

    1. Hello!
      Please try the following formula:

      =IF(OR(A1="nok",B1="nok"),"nok",IF(OR(A1="ok",B1="ok"),"ok",IF(AND(A1="na",B1="na"),"na","")))

      Hope this is what you need.

      1. You are AWESOME!! Thank you!!

  46. Hi - can someone help me write this in a Boolean "IF" statement.

    IF the years of experience is "0" or less than 5 years, the raise is 2%
    IF the years of experience is 5 years and less than 10 years, the raise is 3%
    IF the years of experience is 10 years and less than 14 years, the raise is 4%
    IF the years of experience is 13 years and less than 18 years, the raise is 5%
    IF the years of experience is greater than 17 the raise is "0"

    Tanya

    1. Hello!
      I hope you have studied the recommendations in the tutorial above. It contains answers to your question.
      Your conditions 4 and 5 contradict each other.

  47. Hello! I'm trying to get excel to do an IF function but am having trouble with my formula. I want it to be if Field 1, Field 2, or Field 3 are selected then "Soccer". If Field 4, Field 5, or Field 6 are selected then "Baseball". I'm trying to get excel to automatically bring up with fields are soccer or baseball fields. Thanks!

    1. Hi,
      I hope you have studied the recommendations in the tutorial above. It contains answers to your question.
      Your conditions contradict each other. If the values will be written in all 6 cells, what value do you want to get? “Soccer” or “Baseball”?

  48. Hi, what can I do if I want to print a specific data-field(cell already typed in excel) depending upon a value entered by the user?

    For instance, IF(B1="Petrol", (//I wish to print cell D1 adjacent to it))

    1. Hi,
      You can use the formula

      IF(B1=”Petrol”, D1,"")

      I hope you remember that an Excel formula can only change the value of the cell in which it is written.

  49. Hi,
    Could you help me, i'm trying to write formula to deduct certain value.
    I have a table with certain numbers and i need to leave the same numbers lesser then 2000.
    But numbes:
    greater then 2000 and lesser then 4000 i need to deduct for 10
    greater then 4000 and lesser then 6500 i need deduct for 20
    greater then 6500 and lesser then 9000 deduct for 30
    grater then 9000 deduct for 40.
    Thank you in advance.
    Dragan

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

      =IF(A2>9000,A2-40,IF(A2 > 6500,A2-30,IF(A2 > 4000,A2-20,IF(A2 > 2000,A2-10,A2))))

      1. Hi,
        Sorry but i didn't see them.
        Thank you very much, this resolved my problem.

        Best regards,
        Dragan

  50. Hi!!

    I am writing a formula to determine Pass/Fail. I used an IF .formula which states this =IF(D6>=75%,"P","F").
    It is stating P/F correctly in every instance EXCEPT where the grade matches or is equal to the 75%. In that instance it is reporting and "F" even though 75% or above is passing. I have trying writing the formula 100 different ways and no matter what I try it will not give a "P" to any cell with a grade of 75%. Please Help!!

    1. Hello!
      I have not been able to replicate your problem. You may be calculating the value in cell D6. In this case, the value on the screen may not match the real one. In this case, you need to use the ROUND function.

Post a comment



Thanks for your comment! Please note that all comments are pre-moderated, and off-topic ones may be deleted.
For faster help, please keep your question clear and concise. While we can't guarantee a reply to every question, we'll do our best to respond :)