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 110. Total comments: 4830

  1. Hello,
    I have a spreadsheet layout as follows:
    Inv date

  2. Hi I run a works lotto syndicate and I would like my winnings spreadsheet to add up the number of wins to total the amount in money ie Cell A1 is 1 win the total cell I1 is £3, the next week A1 is 2 wins so I1 = £6 and so on, is this possible?
    Thank you
    Michael

  3. Hi all,
    In the cells of column C I'd like to get the following numbers, based on the numbers in the cells of column B:
    Bx = 0-14 -> Cx= 0; Bx = 15-30 -> Cx = 1; Bx = 30-60 -> Cx = 2; Bx > 60 -> Cx = 3

    I used the following formula in the cells of column C:
    =IF(B2>=60,3,IF=(B2>=30,2,IF=(B2>=15,1,0)))

    However, Excel does not recognise the final 'B2' as a cell in the formula (e.g. it does not get coloured and it returns a message that there is an error in the formula).

    Could you please tell me what I'm doing wrong?

    Thanks in advance!

  4. Hi
    I have a problem in DVI/o, How I can remove this error from Excel. the formula is ('S'!C2-'Dry-Phase'!C2)/('Sat-Phase'!C2-'Dry-Phase'!C2. How I can use IF formula to eliminate this error and used o instead of it?

  5. hey i need help for this, im making kind of a game in excel, like rock paper scissors and i need help.i have put in result if function and all is done but if i input something other than "scissors" "rock"or"paper" ,says false,so i put in if(...,"you win",c3"doesnt exist") /c3 is cell where i put user choice and i need help if it is possible to write whatever is written in user choice + "doesnt exist.".Example:

    C D E
    3 User choice Result
    4 Dog Dog doesnt exit! /so c3+"doesnt exit"

    if anyone knows please help, only that i need to finish

  6. Hi, I've looked through and couldn't find the answer to my particular question.

    I have four columns with 0/1/blank in them. Based on if they have 1 in it I'd like my new column to say International", Regional, National... HOWEVER, some countries have 1 in more than one column.

    This is what I've got so far, which is OK if they have one answer, but how do I get to an answer like, "International, National"?

    =IF(CB5=1,"International",IF(CC5=1,"Regional",IF(CD5=1,"National",IF(CE5=1,"Intermediate"))))

    Many thanks in advance
    J

  7. i need the person to make 10.19, but if he does how can i get the IF function to work ?

  8. i want to know the below formula :

    if value is 10000>="200" and 10000< value "150"

    kindly show the formula with"and"...

  9. Hello

    I Hope you can help me with this,

    I want to create a formula where I can say this cell is = to a cell in another sheet, but if its blank, leave it blank, otherwise place the information

    example

    =IF(MASTER!D60,"","???") WHAT I WANT IS TO SAY THAT THIS CELL IS = TO THE OTHER CELL AND IF THE CELL IS BLANK, LEAVE IT BLANK DONT PLACE ANY NUMBER OR FORMULA OR ANYTHING

    thank you in advance

    1. if i got it right, i think it goes like this:

      =if(D60="","",D60)

      /this says if the cell d60 is empty(""),leave it empty(""),and if not input the text from it here.

      1. Good Day
        Thanks for the above answer
        if i got it right, i think it goes like this:

        =if(D60="","",D60)

        /this says if the cell d60 is empty(""),leave it empty(""),and if not input the text from it here.

        So I have a situation whereby I have 4 columns (A,B,C,D), I have information in either of the columns. I want the information to be populated in column E.
        I found the above if function don't work for multiple column ranges or maybe I just get it wrong. Please assist

  10. Need an IF THEN formula that covers multiple worksheets for a Quote template that users will be entering part numbers in to return certain prices.
    SHEETS - 1.Intro - where promo code is selected from drop down cell,2.Pricing - where the user enters the part number and the desc & price auto-populates, 3. - Data Sheet)
    I want the formula to look at a cell in the Intro Sheet and IF it contains data (a promo code) THEN return the price associated with the part number, If there the promo Code cell is empty then return the non-discounted price.
    In my data sheet I have columns that contain part numbers and non-disc price and columns that have the promo code, part number and price associated with that code.

    Easy right?

    Basically If PROMO CODE is entered THEN apply promo pricing for material entered IF not THEN use normal pricing for material entered.

  11. Hi ...

    I'm a newbie with Excel

    I would like to create a formula that "average the number of failed in a column ... In the top of my report I have 2 cells one for "%Failed" and the other for "%Success" ... my column is populated with "F" and "S".

    So it's a "IF" follow by a "Count" or "Average" ?

    Thanks

  12. Hi
    How would i create formula for when in a word 4th letter is "c" then true or false

  13. How would I create a formula for getting a cell to populate a specific word related to a specific number? Example A1 = 01, I want B1 to always show FRONT, if A1 = 02, B1 = BACK

    I have a list of varying numbers 50 numbers and each number is associated with a word.

  14. Hi,

    I hope you can help

    I am using this formula, but the cell I am using it in shows £300 when C4 is 0.00.

    When C4 is 0.00, I also want the cell to show as 0.00 until any information in entered, how do I incorporate this into the formula?

    =IF(C4=300,0,C4))

    Thanks in advance

    1. Hi James,

      Here you go: =IF(C4=0,0,C4)

      1. I want a formula if the ans is NO in one column then 888 in the next coulum

      2. Part 2

        IF(C5>=300,0,C5))

        1. James,

          Our blog engine often mangles formulas with comparison operators, sorry for that. If my understanding is correct you want the formula to return 300-C5 if cell C5 is less than 300, otherwise return 0:
          =IF(C5<300,300-C5,0)

          If you are looking for something different, please express the conditions in words and we will try to work out a proper formula.

      3. Sorry my formula didn't come up as I typed it, I'll try sending it in 2 parts

        =IF(C5<300,300-C5,

  15. Can you sum up the results of an IF statement if the result is a number? How?

  16. hi, can you help me i have this if problem everytime i do more than 1 value i keep getting Error.. i have this this to appear on my excell

    Yes=Approved
    No=Location too far
    ?=Missing location

    -and if possible to add more kindly add

    e=Escalate
    i=inappropriate content
    p=no facebook photo

    thanks for the future help.. more power.. :)

  17. Hi Svetlana,

    I would like to combine these two formulas in one cell. I'd like to see results that are a positive number, replace a negative number with a blank cell and replace errors with "no data". I can get them to work independently but not sure how to combine them. Any help you could give would be greatly appreciated.

    =IF(ISERROR(NETWORKDAYS(J64,K64)-1),"no data",NETWORKDAYS(J64,K64)-1)
    or
    =IF((NETWORKDAYS(J68,K68)-1)<0,"",NETWORKDAYS(J68,K68)-1)

    Thank you,Sarah

  18. Hi ,

    I want formula for below value 0, 1 & -1 as ok, Excess & short respectively.

    What will be the formula.

    0 ok
    1 Excess
    -1 Short

  19. hello.....i have five different trucks for holding, each one has a serial of three numbers and each has different volume.. how can i use "if equation" or another one to gain more time inorder to not refill each time the repeated data for the driver..... i want when i type the driver name in cell A, i may have the truck number of this driver in cell B and the truck volume in cell C

  20. I need a formula that will satisfy these conditions. The nominee must be male or female with more than 500 votes to qualify. My formula was wrong. Any suggestions?

    1. Hi Johnny,

      If you give more details about your data structure, I think we will figure out a proper formula.

  21. i want to use a formula for good or bad
    Examaple if i entre D6 value should have condition =< 12 is good and lower than 11.8 should be bad .

    Please help in how to use formula

    1. Hello Vishnu,

      Here you go:
      =IF(AND(D6<=12, D6>=11.8), "good", IF(D6<11.8, "bad", ""))

  22. Hi Svetlana, This is Amit.
    I want to check if numbers in first cell (3 numbers i.e.279) are matching with with second cell (8 numbers i.e. 27895613) and write result as "Match" or "Not Match" in third cell.
    for example,
    1. First cell - 123 Second cell 12435678 Match
    2. First Cell - 231 Second cell 23457698 Not Match

    1. Hi Amit,

      Try the following formula:

      =IF(A1=LEFT(B1,3)*1, "match", "not match")

      It compares a 3-digit number in cell A1 with the first 3 digits of a bigger number in cell B1.

  23. I need help creating a formula, please! I need column C to return today's date, only if column A and B both have a date in them. So if only one of the columns have a date in it then column C needs to remain blank. Column A already has an IF formula in it to populate it with today's date if another criteria is met. Hope there is someone who can help, as I am relatively new to formulas...Thanks!

    1. Hi Alice,

      If row 2 is the top-most row with data in your worksheet, you can enter the following formula in C2 and then copy it down to other cells in column C:

      =IF(AND(A2<>"", B2<>""), TODAY(), "")

      1. I was sure I had tried every variation possible, but clearly not! This has worked perfectly, thank you - I was about ready to scream :)

  24. Hi Svetlana,

    if have part of a If function =IF((AND(F33="Mild steel",F34="1mm")),"1.3".....

    is it possible to change to vale 1.3 to a cell that has the value in it, for example..

    =IF((AND(F33="Mild steel",F34="1mm")),"= F28"?

    if not. is there any way the "value" could be what is written in a cell?

    thank you in advance.

    Stephen

    1. Hi Stephen,

      If my understanding of the task is correct, here’s the formula you are looking for:

      =IF(AND(F33="Mild steel", F34="1mm"), F28, value_if_false)

  25. Ecxel is now a piece of cake.

  26. Give me a formula for:
    If c4=10 there will be 2500 commision, or if c4=15 there will be 5000 commiosion

    1. Hello ZAHIR,

      Here you go:

      =IF(C4=10, 25000, IF(C4=15, 5000, ""))

  27. i have two sheets 1 & 2. I need to put the employee names on sheet 1 columns a1:a10 to sheet 2 column d...what should be my formula? i want to automatically put there instead of retyping or copying it

    1. Hello!

      Just enter the following formula into cell D1 on Sheet2 and then copy it down to other cells:
      =Sheet1!A1

  28. I have 13 columns and 26 rows. Rows list names of staff and columns list the months of the year. For each staff name listed on each row, when "yes" is entered into any one of the 12 columns (months of the year), I would like the other 11 empty columns to automatically turn to "NO". That way it prevents "yes" from being used more than once in that year.

  29. I am trying to get an IF or or formula to work but having slight problems arise. My problem is that there are 36 state in india every state starting 2 tin no. are diffrece, i would like to ask that we want to formula as
    example: 27=Maharashtra,01=jammu & kashmir, 02=Himachal pradesh, 03= Punjab ----------------------------------------------------------- etc.
    i want to formula that ( if column no. is 27 that maharashtra than 01 jammu & kashmir as 36 state.
    So pls. help us.

  30. Hi kindly assist me with a syntax of If function that whent true types a value in a cell, ie, if a2=2, then it tyepes the value tyhat is in cell 3

  31. Hello Sir,
    One doubt,
    I have a set of production data for a month. I want to split it into two items based on two prices. ie: suppose I want to choose the data for the first 10 days, and the remaining days figures alone neglecting the first 10days figures,
    can u throw some light into this,
    thank u.

  32. somebody let me know what does it mean by formula =IF(A7="","",A7) in excell

    1. Hello Waqar,

      Your formula reads as follows:

      "If A7 is blank, return an empty sting (blank cell), otherwise return a value in A7."

  33. Hi there I want to make an If statement that will accept 2 values as being equal when being in a suitable range =IF(B14 = D14+-1,"Yes","No")

    Where B14 and D14 are numerical values that are equal to 1 decimal point

  34. is it possible to have a formula for multiple IF's or another formula for if A2 is upto 127.99 the output would be 15.33,if A2 is between 128 and 187.99 the output would be 35.15 and if A2 was 188 and 244.99 the output would be 48.26.

    Thanks

    Jason

    1. Hi Jason,

      You can use the following nested IFs:

      =IF(A2<=127.99, 15.33, IF(A2<=187.99, 35.15, 48.26))

      The above formula returns 48.26 for any number greater than 188. If you want to limit it to 244.99, add one more IF statement that would return an empty string for all numbers greater than 244.99:

      =IF(A2<=127.99, 15.33, IF(A2<=187.99, 35.15, IF(A2<=244.99, 48.26, "")))

  35. In Exel sheet, condition: suppose i put funtion in C4. value is A4 is 1000 than consider B4 value in C4 cell.

    Please suggest me formula.

  36. Hi,
    I have a report that generates to a word doc that I then import into a excel spread sheet. The text imported is Priority 1 Priority 2 Priority 3 or Priority 4, I cannot just import the number alone so I can then generate a chart from the imported numbers. What I was trying to use is an if to turn the Priority 1 to a 1.

  37. If the results of the following formula are <0 I would like to have the cell read "pending" instead of the actual negative number. Is there something I can add to the formula to make that happen?

    =IF(ISERROR(NETWORKDAYS(B54,L54)-1),"no data",NETWORKDAYS(B54,L54)-1)

    thank you

  38. What "if formula" can I use, to identify the following:
    If any of the column is empty (although others are completed), it should pop up a message?

  39. I need a formula that will alert me if there are 5 or more consecutive negatives (or losses) in a column? Help :)

  40. Hi there. I have 3 columns. I want a 1 in b1 to give 850 in total column e1, a 1 in c1 to give 1350 in total column e1, a 1 in d1 to give 750 in total column e1, if I use 2 in a cell I want it to multiply the number by 2 etc.

  41. If TV personality is popular OR if they earn less than 100k per year thay get 10% bonus else the column should diaplay nil..how can i develop that function

  42. I need a formula that will look at E6, E7, E8, E9, and E11. If 2 of them are >9 add .5, if 3 of them are >9 add 1. Any suggestions?

  43. like
    =IF(E13="Salary"),(L13*$M$10),"Nil")

  44. Hi Svetlana Cheusheva,

    Kindly if you could guide, If E13 is equal to "salary" (text), it should multiply the values mentioned in Cell L13 and $M$10, otherwise N/A. Thanks

    1. Hi Aamir,

      Here you go:

      =IF(E13="salary", L13*$M$10, "N/A")

  45. I want to learn excel.

  46. Hi Dear,
    I need a formula to G16 where if F16 says "YES" then G16=C16-8

    1. Hi Fatema,

      Here's the formula for G16:
      =IF(F16="yes", C16-8, "")

  47. A1 = RECEIVED / CANCELLED / DECLINED (Dropdown)

    If A1="CANCELLED" then A2, A3, A4... will show CANCELLED
    If A1="DECLINED" then A2, A3, A4... will show DECLINED

    but

    If A1="RECEIVED" then A2, A3, A4... must be blank

    Please advise. Thank you

    1. Hi Brenda,

      Here's the formula exactly per your conditions:

      =IF($A$1="CANCELLED", "CANCELLED", IF($A$1="DECLINED", "DECLINED", IF($A$1="RECEIVED", "", "")))

      And I believe this simpler one will work as well:
      =IF($A$1="RECEIVED", "", $A$1)

  48. how to Segregate the Employees Categories from Excel sheet through Formula ? for example I have too many employees job title so I want segregate their profession project location wise through formula how can we do please help.

    1. Hi, Svetlana,

      how to Segregate the Employees Categories from Excel sheet through Formula ? for example I have too many employees job title so I want segregate their profession project location wise through formula how can we do please need your help to give me the Idea Soon.

  49. Using an 'if' function to put in todays date (using 'today()'), but want the date to remain static and not move on when the spread sheet is opened the next day

  50. I am trying to accomplish a multi-faceted IF statement.
    IF cell>02131<40 Then 3

    Is this possible? thanks

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