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

  1. Need Help please... Thank You in advance.

    I have 3 columns.
    Column A - list of country
    Column B - Yes or No
    Column C - country (example in C1="PERU")

    Column D - result should be "Yes" or "No"
    - if C = "PERU" and if all the data with "PERU" in column A has value
    of "YES" in Column B, then "Yes", otherwise "No"

  2. Hi

    I'm trying to figure out a formula using the function IFs where I have 3 conditions to return "e.g. 3 payable commission roles 10% 12% & 14%" - But I am not sure how to write this all in small function in excel !
    This is what I am after "between/equal 100% & 109% then multiple the revenue by 10% , between/equal 110% & 119% then multiple the revenue by 12% ,EQUAL or greater than 120% then multiple the revenue by 14%, return £0 if less than 100% " this is what I have done so far :
    A1 % to target
    B2 £ Revenue
    =IFS(A1=100%,"B2*10%",A1109%,"B2*10%", .....)

    I would really appreciate your help.

    Thank you
    Hasnaa

  3. I have different dates in column B1,B2... and amount in G1,G2... for which i have to calculate service tax pertaining to that date.
    I'm using below formula which is not calculating properly.
    =IF(B5<1/6/2015,G5*12.36%,IF(B5<15/11/2015,G5*14%,IF(B5<1/6/2016,G5*14.5%,G5*15%

    Please let me know in which format the date should be in formula as well as in column B

    Looking for your reply..

  4. Hi Svetlana

    Need a help

    If Cell A1 & B1 have no date Show C3 as Blank
    If Cell A1 have date show C3 as In-Progress
    If Cell B1 have date show C3 as Completed

  5. hi dear ,
    i have data sheet of fragrance product ,trying to find sizes from column to past in to aother column
    for instance column A1 hsd discription of perfume name and its sizes such as 1. oz , 1.5 oz , 2. oz and so on....i would like to just take ""sizes"" from column A1 to collum A2. what would the formula to do this coz i got 10000 products on sheet .
    *
    sizes are about 15 to 20 diffrent types on entire sheet or value which needs to be found and past in to specific collum . how to write formula for this action . thx .

  6. Hi I have query please
    In A2 is the status if I put date in B2 the A2 put "Requested" and if I put date in C2 the A2 change "Delivered" and if I put date in D2 the A2 change "Released".. Please help me thank you..
    What formula can I used.

  7. Hi good day,
    What formula can I used, example if I put date
    Status Request Delivered Released
    Request 10-5-16
    Delivered 10-5-16 10-10-16
    Released 10-5-16 10-10-16 10-15-16

    Please help. Thank you :)

  8. i am trying to get a result back from a cell that has a formula in another cell. =IF(AND(P48),$X$11,""). the results of this formula will be a number. the problem is that when put another formula (=IF(AND($Z$11>0,$W$11<0),$X$12,"")) in another cell it sees the formula not the results of the formula. how can I get excel to see the actual results in stead of the formula.

  9. Hi,

    I am trying to figure out how to format this formula. I need to create a formula that if either of the cells J3 or N3 are blank then S3 is 0. If none of the cells are blank, then I want S3 to be N3-J3

    Any thoughts?

  10. Hi, i was wondering is there any formula in excell that will be able to help me with the following. if i put in a value from 1-10 the following must happen, if i enter 1 it must calculate to 12 and 2 must go to 10 and 3 to 8 and so on, and it must calculate over a few cells.
    i hope you wil understand what i said here.

  11. I need a formula rule for formatting so that the current date is referenced and anything previous to it is highlighted and subsequently anything 30 days after the current date is highlighted differently?

  12. Can you help me with the formula.

    Suppose I want to find M in the formula

    [M-X]

    X is a known value
    and I want to find M .
    The criteria is
    1. M = x if X is between 98.5 and 101.5
    2. M = 98.5 if X is smaller than 98.5
    3. M = 101.5 if x is greater than 101.5

    All three conditions I want to include in one cell. How can I perform it. Please help.

  13. Hi,
    In Cell "AE2" I need to show always "URGENT" until CELL "V2" value is " " (Blank). when Cell "V2' goes Greater than 0, Cell "AE2" need to show the value of Cell "V2".
    Please some body help

    Thanks

    1. Hi!

      Try this formula:

      =IF(V2="", "URGENT", V2)

  14. Works perfect. Thanks

  15. =IF($K3<=500,$K3*1900,IF($L3<=500,$L3*1900,IF($M3=1000,"High Power Distance", IF(M3="-","No Grid")))))

    For above formula, i will get High power distance for "-" in cells.
    I want to display "No grid" for value - or blank space.

  16. Hello,

    I'm using the following formula:
    =IF(OR($J34="CM",$J34="PDC"),$M34,0)
    In the cell it show #name?. What is wrong with the formula.

    Regards,

    Jercon

    1. Hi Jercon,

      The problem is in smart quotes (”CM” and ”PDC”), which is often the case when copy/pasting formulas. Just retype the quotes directly in the formula bar, and your formula will start working properly.

  17. Dear how to use if below formula
    0-30 and 31-60 and 61-90 and Over 90 days

  18. Help with this?
    =IF('Menses Tracker'!E2="Re-Occuring", "=DATE(YEAR(C2)=1,MONTH(C2)+1,DAY(C2))", "=DATE(YEAR(C2),MONTH(C2),DAY(C2)+90)")

    Basically what I want is if on the first sheet(menses tracker) in cell E2 is says Re-Ocurring then I want it to calculate a date using the date in cell C2 + 1 year and 1 month, if it does not then I want it to calculate the a date using the date in cell C2 =90days.

  19. dear Svetlana Cheusheva,

    have a nice day,

    i have 2 quires please help.
    1- can we use if and count-ifs formula in one cell.
    2- i am using this formula =CONCATENATE(TEXT(K33,"(DD-mmm-yy")&" To ",TEXT(K34,"dd-mmm-yy)"))i 2nd date is less then first date how result show as massage " Wrong Date.

    i am expecting your kind and early response.
    thanks

  20. hi i have query please solve it

    NUMBERS REQUIRED ANSWER
    1 2,3,4
    5 6,7
    8 9,10,11
    12 13,14,15
    16 17
    18 19
    20

  21. hi i have query please solve it

    A B
    1 DATA REQUIRED ANSWER
    2 1 2,3,4
    3 5 6,7
    4 8 9,10,11
    5 12 13,14,15
    6 16 17
    7 18 19
    8 20

  22. I want to make formula where for e.g. IF A1 = 660, and I want if A1/60 i.e. 11 is greater than 3 then it should Multiple A1 with 100

    Here I took UNIT type of 600 as "Seconds" if it is more than 3 minutes after dividing by 60 (please Remember) then A1 should multiplied by 100 else the result should be ZERO.

  23. hi,

    could you please some help me this formula?

    Average of 24 units is equal to or greater than Q, not more than 2 units are less than Q − 15%, and no unit is less than Q − 25%

    Q value= 80%

  24. hi, can someone help me with this formula? I am making an if/or furmula showing that if the service years>3 or is a college graduate the column will be a yes. (only one condition needs to be met) I have:

    =IF(OR([@[College Graduate]]="Yes")([@[Service Years]]>3,"Yes","No")

    thanks.

    1. Hi Jordan,

      The correct syntax of the IF/OR formula is this:

      =IF(OR(condition 1, condition 2), value_if_true, value_if_false)

      In your case:

      =IF(OR([@[College Graduate]]="Yes", [@[Service Years]]>3),"Yes","No")

  25. How decimal numbers can be compared?

    =IF(A1>2.34,"A","B")

    If A1=2.21, it shows B

  26. Hello,

    I see all you are very supportive, Pls help to solve this.
    i have a data,

    Column A Column B Column C Column D Column E
    FFA Exp Gain 1 Gain 2 Evoporate

    1 125 98% 1% 1%
    2 200 96% 2.5% 1.5%
    3 235 95% 3% 2%
    4 345 93% 5% 2%
    5 430 92% 5.5% 2%
    6 510 90% 8% 1%
    7 740 87% 10% 2%

    so on

    i want when i enter 1,2,3..... in a box my below mention results from above data shows to me, is it possible???

    Exp 125
    Gain 1 98%
    Gain 2 1%
    Evoporate 1%

    Regards,

  27. Hi,

    I want to use if function for a data entry purpose. I want it as if a particular column contains a particular name the very next cell should mention the city of the particular person's name.
    Eg:

    if the column contains the name Kumar his city Bombay should appear just next to his name.

    Please help.

    Thanks in advance

  28. I need to verify dates. I need column a and b to be the same if they are not I need to distinguish. How would I create this formula?

    Please help!

  29. hi

    i have this table

    m1 width m2
    330

    I want to calculate from m1 to m2 and viceversa. Is it possible to do that in the same cells?

  30. i need to validate a cell. The cell will contain values from 1-10. 1-6 the values will be considered not at all likely 7 and 8 will be neutral and 9 and 10 will be considered as extremely likely. Can you please help me with an if loop formula ?

  31. "Monthly Grand Total(Minus Applicable Discount)-The sum of all campaign cost for each month, including postage, envelops and messaging cost. If a high volume discount is applicable, it should be calculated here as well. Keep in mind two conditions must be met before the discount can be calculated: The discount threshold must be greater than zero and the yearly total mail volume value must be greater than the threshold"
    Can you tell me the formula for this, please?

  32. Hi

    please share if function the below mentioned query

    Salary and Wage earners-Such persons whose
    monthly
    salaries or wages :-
    (a) do not exceed rupees 7,500; NIL
    (b) (i) In case of male, exceed Rs. 7,500 but do not
    exceed rupees 10,000;175 per month
    (ii) In case of female, do not exceed Rs 10,000; Nil
    (c) exceeds rupees 10,000 2,500 per annum

  33. I am trying to evaluate a date in the previous cell. If the date is before the 15th of the month I wan the evaluation cell to return the first of the month. If it is equal to or greater than the 16th of the month, I want the evaluation cell to return the 15 of that month. Examples:

    Cell A Date Cell B Returns
    10/8/16 10/1/16
    10/16/16 10/15/16
    11/3/16 11/1/16
    11/22/16 11/15/16

    Any thoughts or suggestions are really appreciated!!!

    Charles

    1. Hello Charles,

      Try the following formula, where A2 is the date in the "previous cell":

      =IF(DAY(A2)<16, DATE(YEAR(A2), MONTH(A2), 1), DATE(YEAR(A2), MONTH(A2), 15))

    2. Hi Charles,

      Here You Go,(Paste in B1)

      IF(DATE(YEAR(A1),MONTH(A1),DAY(A1))=DATE(YEAR(A1),MONTH(A1),"16"),DATE(YEAR(A1),MONTH(A1),"15")))

  34. This might sound simple but I'm not as bright as I'd like to think. if j48 = 9 then 10, if j48 = 10 then 9. please help

    1. Hi George,

      You can use a couple of nested if's like this:

      =IF(J48=9, 10, IF(J48=10, 9, ""))

  35. In Col I Write a formula to give rank to student In Col I Write a formula to give rank to student based on below table (Without using IF Condition)

    Marks Grades
    =33 but less than 60 Pass
    >= 60 but less than 70 3rd Div
    >=70 but less than 80 2nd Div
    >=80 but less than 90 1st Div
    >=90 Distinction

    based on below table (Without using IF Condition)

    Marks Grades
    =33 but less than 60 Pass
    >= 60 but less than 70 3rd Div
    >=70 but less than 80 2nd Div
    >=80 but less than 90 1st Div
    >=90 Distinction

  36. Hi, I wish to use the sumif the range cell data as follow, it is that possible?
    If(A1=B1,C1,0),
    (A2=B2,C2,0),
    (A3=B3,C3,0),.....
    AND I would like the sum of range cell in column C

    All in one formula, is that possible?

  37. I want to say: if a certain cell equals a value and another cell equals a value then use this value

    Ps. above values are txt not numbers.

    what I got so far is IF((B19="General Trading", B20="One Payment"),"27,185","")

    but it isn't working.

    Please help me

    1. Hello Mahmoud,

      You have to use an AND statement, like this:
      =IF(AND(B19="General Trading", B20="One Payment"), "27,185", "")

  38. hi,I want to use the if function like

    if the A1 is starting with s, then I1 is equal to B1-C1+D1-E1+F1-G1
    if the A1 is starting with m, then J1 is equal to B1-C1+D1-E1+F1-G1
    if the A1 is starting with z, then K1 is equal to B1-C1+D1-E1+F1-G1

    pls help me with this formula, thanks

  39. Hi I am a basic excel user, I am using excel 2016, my question is:

    I am using the formula =IF(X4030="",TODAY()-W4030) to get the result but if the cell W4030 is blank the result is some strange value, I want excel to display nothing if the cell W4030 is blank, how can i fix this. Please help. Many Thanks

    1. Hi Syed,

      Try this one:

      =IF(X4030<>"",TODAY()-W4030, "")

  40. Hi, Svetlana,

    I would appreciate it if you could help me with this

    I am trying to display contents of a table T1 if value of D2 is BAT

    in a Cell E2 =IF((D2="BAT"),T1,"")
    but it gives #value! error. How can I display the table T1?

    T1 table is made up of G7:I11 cells.

    Looking forward to hearing from you

    Thanks in advanced.

    Warm Regards,
    Vilas.

    1. Hi Vilas,

      The IF function cannot display the contents of an entire table in a single cell. You can write a formula to extract the data from the upper-left cell of your table, and then copy the formula to an empty range containing the same number of rows and columns as your table does to pull the values from other cells. For example: =IF(D2="BAT", T1, "") Where T1 is the left-most cell of the table.

  41. Hi,

    I have some values in column A(row1:row10) and column B(row1:row5). I need to compare column A values with column B, if any matches means, I need that value in column C.

    Example:

    Column A Column B Column C

    1 5 1
    2 6 2
    3 1
    4 2
    5 8 5
    6
    7
    8 8
    9
    10

    Pls give me the formula to perform above operation

  42. Hi There,

    I want to create a multiple formula as follows:
    =IF(D3=1,16000000,IF(D3=2,12000000,IF(D3=3,5000000,3000000)))

    But, it doesn't work on my Excel 2013. Is there something wrong with the formula?

    Please advise.
    Thanks.

  43. columnA ColumnB
    mango fruit
    apple fruit
    orange fruit
    pepper spice
    salt spice

    How do I input a formula under columnB to have answer either fruit or spice?

  44. i want to formula for whose name or spell starting or includes in name e.g. s the name selected.

    such as suman,sumit ,hans,kiss, then what is the formula for takeing all.

  45. Teacher 1 02:10:05 history
    Teacher 2 09:12:12 social
    Teacher 2 01:12:12 math
    Teacher 2 00:12:12 physics
    Teacher 4 06:12:12 chemistry
    Teacher 2 09:12:12 evs
    Teacher 1 07:12:12 robotics
    Teacher 2 06:12:12 syc
    Teacher 2 02:12:12 health
    Teacher 2 09:12:12 geo
    Teacher 3 02:12:12 indian his
    Teacher 3 01:12:12 french revo
    Teacher 3 01:12:12 language

    here i need to add all the value of the teacher 1.

    i.e., if "teacher 1" is true then it has to display "history,robotics"

    i use the =COUNTIF(A1:A13,"teacher 1") to count the entry of user (teachers)

    and

    i use =SUMPRODUCT(--(A1:A13="teacher 1"),B1:B13) to find the some of the product of an user (teacher)

    and i need your help for the top most "to add all the value of the teacher 1"

  46. All provided learning about excel is very helpful. Thank you Svetlana & team

  47. Hi,
    I want to to create an IF function where the true value will equal the text in a given cell from another sheet. Is it possible to set up?

    thanks

    1. Hello BETHAN,

      Sure, you can do that. For example:
      =IF(1=1, Sheet2!A1, "")

  48. Hi want to get
    if i entered yes in A1,then it should return value 5 in B1,and if i entered NO in A1,then it should return value 0 in B1, is it possible to impelement.Please help me

    1. Hi Anish,

      Here is the formula for B1:

      =IF(A1="yes", 5, IF(A1="no", 0, ""))

  49. Dear Madam,

    i have a cell for date and need to check the month and another cell will appear text according to the month. Example:

    Jan = Cohort 1
    Feb = Cohort 2

    A1 = 5-Jan-2015 and i want A2 to be equal to Cohort 1

    what is the formula for A2 ?

    Thank u in advance!

  50. hi, I need to replace a cell by searching another cell when contain a specific text, would you please help me to know if it is possible or not?

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