Comments on: How to use IF function in Excel: examples for text, numbers, dates, blanks

IF is one of the most popular and useful functions in Excel. Generally, you use an IF statement to test a condition and to return one value if the condition is met, and another value if the condition is not met. Continue reading

Comments page 24. Total comments: 3001

  1. HI!
    I'm trying to use a certain cell name from a list in my IF formula, but it will not allow me to use the character within the name without trying to use the characters function. is there a way to override this? Thank you!

    ex. =IF(D5=3Y) it's wanting to use that Y as a YEAR function and not allowing me to use it simply as a Y.

    1. Hi Stephen,

      If 3Y is a usual text string, then enclose it in double quotes like this:

      =IF(D5="3Y", value_if_true, value_if_false)

  2. hi, how to do this, ex:
    22.7 auto increment to 23 or 22.3 to 22 ?
    if 22.5 till 22.9 to be 23 or 22.1 to 22.4 to 22 ?

    1. Hi,

      Use this formula, your data in a column

      =ROUND(A1,0)

  3. Hello, Excel will not accept the following formula:
    =IF(F3= "yes", [G3*1.1], [G3])

    All I want it to do is return Cell G3 x 1.1 if cell F3 = Yes, else just cell G3. What is wrong with my format?

    1. Hi Paul,

      Just remove square brackets:

      =IF(F3= "yes", G3*1.1, G3)

  4. Hello

    I am trying to work out a formula for a table of rental charges for rooms in a house.

    Column E is 'date from' and Column F is 'date to' and column H is number of days. Rent runs from the 19th of each month.

    I used the following formula to work out rent cost for the number of days they were there which is basically saying

    'if the 'to date' is 19/05/15 then return the monthly rental value as shown in cell C14, but if it is not 19/05/15 then use the number of days multiplied by the daily rental value to give me an amount'

    =+IF(F4=DATEVALUE("19/05/2015"),C$14,0)+IF(F4DATEVALUE("19/05/2015"),(H4*E$14),0)

    I realised though that this only works if the month starts on 19/04/15. I have one tenant that moved in on 08/05/15 and i therefore need to adjust the formula to say that if column F= 19/05/15 and column E=19/04/15 then return the monthly rent but if F doesnt equal 19/05/15 and e doesnt equal 19/04/15 then use the number of days multiplied by the daily rent.

    Is this possible as when i adjust the formula with an AND it comes back as invalid.

    Any help would be very much appreciated!

    Thanks in advance

    1. Hi Amanda,

      Just add the following AND statement in the logical test of both IF functions:

      =IF(AND(F4=DATEVALUE("19/05/2015"), E4=DATEVALUE("19/04/2015")), C$14, 0) +
      IF(AND(F4=DATEVALUE("19/05/2015"), E4=DATEVALUE("19/04/2015")), H4*E$14, 0)

      1. Many thanks Svetlana!

  5. assit me with nested if statement of a traffic robot set up with out come or result of GO,Stop and prepare to stop.

  6. If Column A contains Column B then Yes if not then No

    Can the formula take into account the case sensitivity as well?

    Column A Column B

    \\CCBF0FP21\DCLabels Doejj
    \\CCBF0FP21\DCLabels$ Doejj
    \\CCBF0FP21\DCReports$ Doejj
    \\CCBF0FP21\Direct$ Doejj
    \\CCBF0FP21\Review$ Doejj
    \\CCBF0FP21\DEV$ Doejj
    \\CCBF0FP21\Shipto Doejj
    \\CCBF0FP21\shipto$ Doejj
    \\CCBF0UD2A\UD1$\DOEJJ Doejj

    1. Sorry - the sample data on here is not displaying as 2 columns. To clarify:
      Column A
      \\CCBF0FP21\DCLabels
      \\CCBF0FP21\DCLabels$
      \\CCBF0FP21\DCReports$
      \\CCBF0FP21\Direct$
      \\CCBF0FP21\Review$
      \\CCBF0FP21\DEV$
      \\CCBF0FP21\Shipto
      \\CCBF0FP21\shipto$
      \\CCBF0UD2A\UD1$\DOEJJ

    2. Please Help :)

  7. Hi,

    I made a table for a high, medium,low with corresponding digits.
    Like for example,if the probability of failure is 1(rare) and the impact rating is low, then the result should be low.
    Now, my problem is how do i connect the table to my another sheet.

    please help

    1. try vlookup

  8. i have to do this in excel ,guyz help
    if b=250 value is 15
    if b=260 value is 12

    1. Hi Ajay,

      Here you go:

      =IF(B1=250, 15, IF(B1=260, 12, ""))

  9. Please advise how to use below formula in excel

    =if(L2>60,"Active"),if(L2<60,"Critical"),if(L2<0,"Overdue")

    1. Hi Vinath,

      You'd rather put it like this:

      =IF(L2>60,"Active", IF(L2<0,"Overdue", IF(L2<60,"Critical", "")))

      Just pay attention, please, that the formula returns an empty string if none of the conditions is met, e.g. if L2=60.

  10. I need help with a formula using dates:
    What I am trying to accomplish is if cell G2< 7/1/14 then insert 7/1/14 but if not insert the date that is in G2.
    =IF(G2<DATEVALUE("7/1/2014"),"7/1/2014",G2)

    Thanks for any help,

    1. Hi Monica,

      Your formula is correct. If it returns a serial number rather than a date, you should simply apply the Date format to the cell (press Ctrl+1 to open the Format Cell dialog and select the Date format you want).

  11. Can you help me with this formula:

    =IF(AND(AE303="",AK303=""),Incident),IF(AND(AE303""),AK303="",(NOW()-(AE303))),(DATEDIF(AE303,AK303,"D")))

    I am trying to have the formula:
    (1) if cell AE303 and AK303 are both blank put in the word "Incident", but
    (2) if cell AE303 has a date in the cell and AK303 is blank insert number of days between AE303 and Today, but
    (3)if both cells have dates, subtract them and tell me the # of days between

    1. Hi Lana,

      Try this formula:

      =IF(AND(AE303="",AK303=""), "Incident", IF(AND(AE303<>"",AK303=""), TODAY()-AE303, IF(AND(AE303<>"", AK303<>""), DATEDIF(AE303,AK303,"D"))))

      Just keep in mind please that DATEDIF requires the start date (AE303) to be always less than the end date (AK303), otherwise a formula will return the NUM! error. An easy workaround is simply subtracting one date from the other in the last value_if_false argument:
      AK303-AE303

      1. I'm attempting a similar formula as step (2) noted in Lana's question but I cannot get it to work.

        The sheet has set due dates for a task to be done. There is a column for the completed date (C) and the days overdue (D) based on the due date.
        I'm trying to get the number of days overdue to show in column D (due date is in C2) if there is not a completed date in C, otherwise if there is a date in C, I'd like the cell to stay blank.

        Tried this formula, but it shows as FALSE when there is a date in C instead of coming up blank:
        =IF(AND(C5=""), TODAY()-$C$2)

        [Row 5 is the first row of data excluding the due date in row 2, so I'm intending on dragging down the remaining rows]

        Hopefully you can help me with this!

  12. i need a formula to display a number (2) if the cell says "yes" and display a (4) if the cell says "no"....
    can anyone help?

    1. Here you go:

      =IF(A1="yes", 2, IF(A1="no", 4, ""))

  13. i cannot figure the formula out help!!!
    In cell F20, enter an IF function that tests whether the order quantity in cell E20 is greater than zero. If it is, return the the charge for this item, which is the value of cell E20 mulitplied by cell D20. Otherwise, return a space by entering " " (that is, double quote, space, double quote). Autofill this formula into the range F21:F25.

    1. Hi Ana,

      Here's the formula for F20:
      =IF($E20>0, $E20*$D20, " ")

      Simply copy it down to other cells in column F:
      - select cell F20;
      - move the mouse cursor at the lower right-hand corner of the cell and you will see it changing to a plus sign (fill handle);
      - click the plus and drag it down to fill other cells with your formula.

  14. What if I want to say if cells F1, G1, and H1 are blank, I1 should be blank. If F1, G1 and H1 have numbers, then I1 should be F1+G1+H1.

    1. Hi James,

      Should I1 be blank if any of cells F1, G1, and H1 is blank or if all 3 cells are blank?
      And what if any of those cells contains a text value?

  15. Hi

    Need to insert if formula where there are four dates (one in each column) and need a yes answer if any of the dates are greater than one date but less than another date. eg. if any of the four dates were greater than 01/06/15 but less than 30/06/15 I need the answer to be yes

    Thanks. LP

    1. Lindsay,

      Please use this formula:
      =IF(OR(AND(A1DATEVALUE("01/06/15")), AND(A2DATEVALUE("01/06/15")), AND(A3DATEVALUE("01/06/15")), AND(A4DATEVALUE("01/06/15"))), "Yes","")

      Where A1, A2, A3, A4 are cells with the dates.

  16. How to set if condition for following:

    =ROUND(VLOOKUP(G6,'2012 IAM Table raw'!A$2:D$122,4,FALSE)*((1-VLOOKUP(G6,'2012 IAM Table raw'!A$2:E$122,5,FALSE))^F6),3)/1000

    this round value will return some value, if values is not return need to set the field value to 0 (zero)

    1. Hi Harish,

      You can try to wrap your VLOOKUP function with IFERROR like this:

      =ROUND(iferror(VLOOKUP(G6,'2012 IAM Table raw'!A$2:D$122,4,FALSE) * ((1-VLOOKUP(G6,'2012 IAM Table raw'!A$2:E$122,5,FALSE))^F6), 0), 3)/1000

  17. Dear Svetlana,
    I tried =TEXT(O2,"dd-mmmm-yy") and which (O2)=IF(B2="delivered", TODAY(), "")
    it workeed yesterday and (cell P2) shown 12-May-15 but it updated to 13-May-15 today morning.
    So how to lock the date(cell P2) at 12-May-15?

    thank you.

    1. Hi Zhao,

      Regrettably, it's not possible to lock the date using formulas. You either have to replace the formula with its value each time manually (Copy > Paste Special > Value) or write a VBA script that automates this.

  18. For some reason, every time I submit my question, it cuts down on how I originally wrote my formula.

    =IF(AND(A1>=1,A1=5,A1<10),5,10))

    This will only return the number 10.

    1. Hi Eric,

      Our blog engine often mangles formulas in comments, sorry for this. Could you please describe your conditions in words, so that I can understand the logic? So, the formula should return:

      5 if ?
      10 if?
      1 if?

  19. Hi, working on an excel spreadsheet for invoices.
    Column A is quantity, b & c are description, D is unit price and E total

    I need a formula that calculates A*D in column E but remains blank when column A is blank

    Thank you

    1. Hi Fitz,

      Try the following formula:

      =IF(A2<>"", A2*D2, "")

      1. if the same way I want to get "Yes" if value greater than A1, else remain blank. Also if there is no value in A1 still remains blank

      2. awesome. perfect. thank you Svetlana

  20. =IF(B2="delivered", TODAY(), "")

    I use this formula to generate delivery date, but i found that the date will updated to the date of next day... So how to maintain the date there for me to check the delivery date few days later? thanks.

    1. hi..
      i have just got answer from your previous post that

      "How to convert date to text using Excel TEXT function and no-formula ways"

      ...ha, it`s helpful, thank you very much, but i am not sure whether it will be updated tomorrow

  21. =IF(CV2<=28,"Poor", IF(28<CV2<=42,"Borderline","Acceptable"))
    I wrote the formula above but it's only selecting "Poor" and "Acceptable", leaving out "Borderline" Any help?

    1. Hi Phil,

      Regrettably IF cannot understand expressions like 28<CV2<=42. You have to use an AND statement is this case:
      =IF(CV2<=28,"Poor", IF(AND(CV2>28, CV2<=42),"Borderline","Acceptable"))

      But in fact, checking for CV2>28 is superfluous and you can put it simply as:

      =IF(CV2<=28,"Poor", IF(CV2<=42,"Borderline","Acceptable"))

  22. I have a column of repeated names and a column of values against the names say C2:C101 (names) and I2:I101 (values). I have tried to work out a formula that looks for one of the names in column C and gives a total of all corresponding values in column I.
    I have tried variations of =IF(C2-C101="Walker, David","SUMI2-I101","0") but I just cannot get it to work.
    Can you help please.
    Thank You

    1. Microsoft Excel has a special SUMIF function for this purpose, which makes the formula as simple as:

      =SUMIF(C2:C101, "Walker, David", I2:I101)

  23. I am trying to design a function to produce a "grade" based on a number of columns.

    There are three possible grades given: UNSAT, SAT, SUP

    There are eight graded sections(columns), each with one of the given grades above.

    I want the ninth section to produce an OVERALL grade based on the previous grades.

    SUP on 7 or 8 of the previous eight grades (columns)
    UNSAT on 2 or more of the previous eight grades (columns)
    SAT in all other cases.

    Thanks for any help you can provide!

    1. Never mind! I found the answer by using a mixture of IF and COUNTIFS Functions:

      =IF(COUNTIF(A24:G24,"SUP")<7,"SAT","SUP")

      This answer actually nullifies the requirement to have an UNSAT answer in the field, only because it was easier for me to count an UNSAT manually vice work the multitude of function. If i do find a better answer (to my own question haha) I will update it!

  24. Oh, dear! Can anyone please help?!?

    I have been working on finding a formula to work in a spreadsheet and can't find the correct one to produce the results I need.

    I want to say: IF C6=X,or C7=X, or C8=X, or C9=X, or C10=X, or C11=X, or C12=X, or C13=X, THEN C4=X.

    Every time I try using an IF statement or an OR statement, it doesn't work properly and it says my formula is broken.

    Does anyone know what the correct formula would be for this? I have spent hours using tutorials and working out formulas but still can't get this to work. ANY help would be greatly appreciated!!

    1. Hi Julie,

      Try entering one of the following formulas in cell C4.

      If X is a text value:

      =IF(OR(C6="X", C7="X", C8="X", C9="X", C10="X", C11="X", C12="X", C13="X"), "X", "")

      If X is a number, say 1:

      =IF(OR(C6=1, C7=1, C8=1, C9=1, C10=1, C11=1, C12=1, C13=1), 1, "")

  25. Hi Svetlana,

    I have two problems I can't solve. I hope you can help me!

    I have a value in Column D. I want to subtract that value from 20. If the result is 0 or less, I want Column J to show 0. If the result of 20-D is greater than 0, I want to display that value.

    For example:

    The value in D4 is 22, 20-22 = -2, therefore J4 shows "0".
    The value in D4 is 14, 20-14 = 6, therefore J4 shows "6".

    Here is the formula I have in Column J: IF(SUM(20-D4)=0,),"0",(SUM(20-D4)

    It doesn't work.

    Also, I have a value in Column F. If the value in Column F4 is equal to 100, then Column L4 should show 5. If the value in Column F4 is between 90 and 99, Column L4 should show 4. If Column F4 is between 80 and 89, Column L4 should show 3. If the value in Column F4 is between 70 and 79, Column L4 should show 2. If Column F4 is between 60 and 69, Column L4 should show 1. If the value in Column F4 is equal to or less than 59, Column L4 should show 0.

    For example: The value in Column F4 is 87, therefore Column L4 shows "3".

    I don't understand how to write this formula either. I am new to formulas in Excel and I don't understand the syntax.

    1. Hi Kathleen,

      Here is the first formula:

      =IF(20-D4<=0, 0, 20-D4)

      As for the second task, you need nested IF's here:
      =IF(F4=100, 5, IF(F4>=90, 4, IF(F4>=80, 3, IF(F4>=70, 2, IF(F4>=60, 1, 0)))))

      I hope these are the formulas you are after :)

  26. Hi Ms. Svetlana,

    Can you help me on this?

    IF today's date, range from 1 to 15; my date input should be mm/15/yyyy in a cell.
    But IF 16 - 31; date input should be mm/30/yyyy.

    I have formula but not working properly:
    =IF(DATE(YEAR(TODAY()),MONTH(TODAY()), TODAY())>15, DATE(YEAR(TODAY()),MONTH(TODAY()),30), DATE(YEAR(TODAY()),MONTH(TODAY()),15))

    Hope you can help.

    Many Thanks!

    1. Hi Gibson,

      Try this one:

      =IF(DAY(TODAY())<15,DATE(YEAR(TODAY()), MONTH(TODAY()), 15), DATE(YEAR(TODAY()),MONTH(TODAY()),30))

      1. Whoa! Thanks for the response. Many Thanks! :)

        Btw, do you have any eBook I can buy?

        1. All I have is the articles published here on ablebits. But thanks for the idea :)

  27. I want to add the value of certain cells only if the value = 1.
    I have a list of guests to attend an event; I conditioned the cells so if they are attending and I type a 1 the cell goes green, 2= RSVP TBD and cell goes yello and 3= not attending and cell goes red.
    I want to know the TOTAL number of guests attending (I will have to add all the cells if the value = 1)
    I tried:
    =IF(C3:C18=1, SUM(C3:C18)) but that returns the addition of all the numbers in that range of cells, regardless if they are 1, 2 or 3)
    THANKS!

    1. Hi Manolo,

      All you need is a simple SUMIF formula like this:
      =SUMIF(C3:C18, 1)

      For more info, please check out our Excel SUMIF tutorial.

  28. Hi Svetlana

    Im trying to make a dynamic sheet for car configurations according to track and weather conditions, not sure if possible specially if they are around 30 tracks or is limited to X number of tracks. The idea is like this

    A1= Track01, Track02, Track03, Track04, etc......
    B1= Dry, Wet

    C1= IF((A1="Track01" and B1="Dry";1;3)(A1="Track02" and B1="Dry";2;4)(A1="Track03" and B1="Dry";3;9)(A1="Track04" and B1="Dry";4;12)) etc.....

    Thanks in advanced :)

    1. Hi Ernesto,

      You can express all of your conditions using nested IF's and AND. For example:

      =IF(AND(A1="Track01", B1="Dry"); 1; IF(AND(A1="Track01", B1="Wet"); 3; IF(AND(A1="Track02", B1="Dry"); 2; "")))

      1. Works at perfection, thanks :)

  29. Hi..I am currently working on sales report and using IF formula. However I encountered IF error message - "IF only takes 3 arguments but this is argument number 4". Appreciate your help on this....thank you

    1. Hi Alynda,

      Yes, the syntax of the IF function allows for 3 arguments only. You can find the detailed explanation of each argument at the beginning of this article. If you provide more details about your formula, we will try to get it right.

  30. if value entered B 1 40 to 45 the value C 2 36 and if enter 46 to 50 , the value C 2 37

    1. Here is the formula for C2:

      =IF(AND(B1>=40, B1<=45), 36, IF(AND(B1>=46, B1<=50), 37, ""))

  31. A B
    10 0
    Please help, B=A"Paid", B=0"Outstanding" and 0<B<A"Pending" Thank you!

    1. Hi Kea,

      Here you go:

      =IF(B1=A1,"paid", IF(B1=0,"Outstanding", IF(AND(B1>0, B1<A1),"Pending", "")))

      1. Hi Svetlana, I working well thank you again for your help and sorry for late checking

  32. Hello,

    I have the following formula so far:

    =IF(A1>=40,"40",""), If the value is less than 40 I need the result to be the exact value in the cell.

    For example if A1= 39.5 I need the result to be 39.5 not blank as I currently have it in the formula. What can I replace "" with to get this result?

    Thank you!

    1. Hi Olga,

      Just replace "" with the cell reference, like this:

      =IF(A1>=40, 40, A1)

  33. Dear Svetlana Cheusheva

    Is this formula correct

    =IF(H2="#N/A", "No", "Yes")

    where #N/A is a result of vlookup which is applied in H2

    1. Please help i am stuck here

      1. Hi Khan,

        You have to use the ISNA function to check another cell for N/A error, like this:
        =IF(ISNA(H2), "No", "Yes")

        1. Thanks Svetlana, I was using ISNA but wrong, this helped.

        2. Really v thankful to you it worked

  34. Hi can you help me formulate one formula for these situations:

    1. If the actual completion date (F9) is less than or equal to the target completion date (E9) then it's ON TIME
    2. If the actual completion date (F9) is greater than the target completion date (E9) then it's OVERDUE
    3. If the target completion date (E9) is greater than the date today (B5) and the actual completion date (F9) is unfilled it's NOT YET DUE
    4. If the target completion date (E9) is less than or equal the date today (B5)and the actual completion date is unfilled it's UNDONE

    My formula I have right now is:
    "IF(F9E9,"OVERDUE",IF(E9>B5,F9="","NOT YET DUE",IF(E9<B5,F9="","UNDONE"))))
    But it says I'VE ENTERED SO MANY ARGUMENTS

    Thanks!

    1. Hi Tetay,

      You have to use the AND function when entering more than 1 condition, like this:

      =IF(F9<=E9, "ON TIME", IF(F9>E9, "OVERDUE", IF(AND(E9>B5,F9=""),"NOT YET DUE", IF(AND(E9<=B5,F9=""), "UNDONE", ""))))

      1. Thanks but it does not work for the NOT YET DUE and UNDONE. I think there is something missing?

        1. Because it still displays ON TIME even if the actual completion date (F9) is unfilled.

          1. Oops... I forgot to check if F9 is not empty in "ON TIME" and "OVERDUE" logical tests.

            Please try this one:

            =IF(AND(F9<=E9, F9<>""), "ON TIME", IF(AND(F9>E9, F9<>""), "OVERDUE", IF(AND(E9>B5,F9=""),"NOT YET DUE", IF(AND(E9<=B5,F9=""), "UNDONE", ""))))

            1. OMG Svetlana! Thank you so much, it's working. YOU'RE AWESOME

  35. I want to replace F2 with value in G2 if value in F2 is 0.

    1. Rukia,

      It is not possible to have a value and a formula in the same cell.

  36. Hi There,
    I use this formula but nothing is coming out:
    =IF(B6>2),"3.86"
    what i need is if b6 is > 2 i need excel to put 3.86 and 3.99 if b6 is <= 2
    Thanks

    1. Hi Teame,

      Please try this one:

      =IF(B6>2, 3.86, 3.99)

      1. Mant Thanks Sve.

  37. I need help figuring out 2 calculations

    1.If cell is blank, then leave cell blank, but if cell has a value then add another cell.

    2.Total cells and then divide by cells that only have value. Example if there are 10 cells, but only 5 have value, you would divide by 5.

    1. Hi Toni ,

      You can use formulas like these:

      1. =IF(A1="", "", B1)

      A1 is the cell you check for being blank/non-blank, and B1 is the cell you add if A1 is blank.

      2. =SUM(A1:A100)/COUNTIF(A1:A100, "<>"&"")

  38. Hi,

    I am currently working with a schedule, and I am trying to make an IF function that if I have a table that will show me who is working each shift, it will look at the schedule and pull the person that is scheduled at a certain time.

    An Example:
    If I have person A scheduled at 11:15 AM and I want there name to be pulled into the table which shows all the employees that work at 11:15 AM how would I do so. Currently the function I am trying to use (=IF(B13="11:15 AM", A13) is not working. B13 is representing the starting time of the shift, while A13 is representing the Employee name. I would greatly appreciate any help you can give on this matter, thank you!

    1. Hi Phillip,

      When comparing dates or times in Excel, you have to use the DATEVALUE and TIMEVALUE functions, respectively, in order to convert a date or time unit in the text format to a serial number that Excel recognizes as a date / time. For example:

      =IF(B13=TIMEVALUE("11:15 AM"), A13, "")

  39. What is the formula when my conditions are;

    If 0<= A < 10 the result is 3
    If 10< A < 15 the result is 2
    If 15 < A 20 the result is 0

    Assuming that the variable A is the value on a certain cell.

    Thanks

    1. Forgot to mention;

      if 15< A < 20 the result is 1

      1. Hi Faith,

        Here you go:

        =IF(AND(A1>=0, A1<10), 3, IF(AND(A1>=10, A1<15), 2, IF(AND(A1>=15, A1<20), 1, "")))

  40. Thank you for the article. I don't know if there is a function to do what I want, but here is basically what I am looking for.

    I have a list of items that I have set to display on a different sheet. I would like a large number of those items (those that start with a 4) to be combined into one cell with a different name in the same list (The 400 Series). Is there a function that will keep my list intact, but combine all the names that start with 4 into my new cell? I don't need a count of them by the way, just the list to transpose itself over as it is now with those specific cells pushed down into one.

    Thank you for the help.

    1. As a follow up and to complicate my question, I am hoping to establish a function to do this dynamically every day when I import new information. If I were doing it only once, I think I could just remove the "4" items and put in a new block, but this would become a timely process if I were doing it every day, because I have the list being dynamically generated, which would bring back all my "4" blocks with the new import each day.

      1. Can I assume my question is too complicated?

  41. Hi Svetlana,

    I need to create the following if statement.

    IF the member type in B6 = "TC" then take the date from B3 and + 10 Days, If the member type in B6 = "T2C" then take the date from B3 and + 15 Days.

    1. Hi Adam,

      Here you go:
      =IF(B6="TC", B3+6, IF(B6="T2C", B3+15, ""))

      Please remember to change the format of the cell with the formula to the Date format so that is displays the date correctly.

  42. Hi Svetlana

    I would like to create in "IF" statement or an "ISBLANK" statement that says that if C2 is blank, populate from D2. If C2 has text, do nothing.

    =IF(C2 is Blank, Populate from D2) or =IF(ISBLANK(C2)=TRUE,D2,0)

    Thank you!

    1. Hello Donni,

      You can use either of the below formulas:

      =IF(C2="", D2, "")

      If cell C2 is "visually blank" (including an empty string returned by some other formula, if any), the formula returns a values from D2, otherwise returns an empty string.

      =IF(ISBLANK(C2), D2, "")

      The second formula returns a value from D2 if cell C2 is absolutely blank (no value, no empty string).

      Please see the Excel IF examples for blank, non-blank cells section in this tutorial for full details.

  43. Hi,

    I have a formula that is returning "Recent" in cells that do not contain dates.

    =IF(C6>DATEVALUE("4/21/2014"),"Recent","")

    Cell C6 = "1 File(s)"

    What can I do to exclude cells that do not have dates?

    1. Never mind this, got it figured out.

  44. Hi,can you help me with formula if for this condition, if F3=A,D3=1,the result for H3=C3 & if F3=A,D3>1 the result for H3=-1 in 1 formula if. Thank you :)

    1. Hi Pichan,

      Here is the formula for H3 as per your conditions. If nether condition is met, it will return a blank cell (empty string).

      =IF(AND(F3="A", D3=1), C3, IF(AND(F3="A", D3>1), -1, ""))

  45. Hi, im trying to place a formula that, according to a "word" I can get a number as true or false value.
    ex.: A1= Casa .......... B1= If=(A1Casa,"2","5"), something like that.

    Thanks in advanced. :)

    1. Hi Roman,

      I believe you meant =IF(A1="Casa", 2, 5)

      1. Yes,sorry...... but I get a warning that I shoud put an apostrophe, but is possible to make work somehow?

        1. Most likely this is because you have ";" set as a List separator (you can check this in the Regional settings). If this is the case, then try =IF(A1="Casa"; 2; 5)

          1. Sweeeeet, perfect, thanks Svetlana :)

            1. Sorry again, work at prefection, but something else that I want to know if possible, Is possible also to make a Image to show in a cell linked to a word in a formula?, if possible can you direct me to a link of how to do it?, thanks again :)

  46. =(D3/B3)if(B3="0"),D3,E3 I get error please help
    D3=hour B3=Sales E3=final number

    1. Hi Daniel,

      Sorry, I cannot follow you. Can you explain the condition (logical test), please?

  47. Hi Clarence,

    Here you go:
    =IF(AND(E20<J21, E20<D21), MAX(F11:F15), "")

    1. it's not working :'(

  48. HELP! :( Working on a sheet I have made a drop down in a cel and I would like the cel next to it to enter text if a certain word is selected in the drop down, is this possible?!?! I am not very good at explaining so I can try my best with whatever questions you have!

    1. For example, if the drop down menu is selected Oranges I want cel G to now have Bananas in it, but if from the drop down Grapes is selected I want cel G to now say Grapes, and so on and so on, honestly have 27 so far in the drop down and need an IF in G if something is in the drop down menu, is this possible?!?!

      1. Hi Ryan,

        If you want a cell next to your drop down list to display the same value as currently selected in the drop-down, all you need is a simple formula like =$A$1 where A1 is the drop-down cell.

        If you want to display different values, then you should use nested IF functions, like this:

        =IF(A1="bananas", "bananas2", IF(A1="oranges", "oranges2", IF(A1="grapes", "grapes2")))

  49. =IF(AH5>69, AG5*5, IF(AH5>59, AG5*4,IF(AH5>49, AG5*3,IF(AH5>44, AG5*2,IF(AH5>39, AG5*1,IF(AH569) and so on.
    pls, can you help

    1. Hi Fred,

      The formula looks good. You just need to finish it properly, by closing all IF statements. I.e. the number of closing brackets should match the number of opening ones. Also, in the value_if_false argument of the last IF, enter the value to display when none of the conditions are met - it's an empty string ("") in the example below:

      =IF(AH5>69, AG5*5, IF(AH5>59, AG5*4, IF(AH5>49, AG5*3, IF(AH5>44, AG5*2, IF(AH5>39, AG5*1, IF(AH5>29, AG5, ""))))))

  50. Hi Svetlana, It would be great if you could help, I think I'm nearly there but getting frustrated :)

    =IF(AND((E4-AG4>=5),50,0),IF(AND(E4-AG4<=-5),50,0))

    I'm building a sports sheet, whereby E4 is the actual spread and AG4 is the predicted spread. If the predicted spread is within +5 0r -5 then 50 points are awarded.

    Appreciate your help
    Kind regards
    Barry

    1. Hi Barry,

      The correct syntax of your formula is as follows:
      =IF(AND(E4-AG4<=5, E4-AG4>=-5), 50, 0)

      And you can make it even more simpler by using the ABS function that returns an absolute value regardless of the sign:

      =IF(ABS(E4-AG4)<=5, 50, 0)

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