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

  1. =if(A1=12," ","12"),if(A1=8,"16"),if(A1=16,"8")

    can anyone fix it... it will a very helpfull for me...

    thank you very much

  2. Hi there I am wondering if you can help me
    I have the following data across columns and the desired outcome would be merge the cells sideways into a new cell and delete the duplicates.
    Column J Column K Column L etc
    Row 2: Article sign up | City1 | City2 = Article sign up, city 1, city 2
    Row 3: Article Sign up | Article sign up | City 1 | City 1 = Article sign up, city 1
    Row 4: Article sign up | Article sign up | City 2 | City 2 = Article sign up, city 2

    Can you help?

  3. Hello everyone,
    I'm looking for a formula that looks at date ranges - so if the date of the line item is between 'date 1' and 'date 2' then display the line item in on a separate sheet.
    Similarly if the date of the line item is NOT within 'date 1' and 'date 2' then display the line item on another sheet.

    Any assistance would be greatly appreciated!

    1. Hi Lorna,

      You need two different formulas like these:

      1. If between 2 dates:

      =IF(AND("line item date">date1, "line item date"<date2), "line item", "")

      2. If outside the date range (not within 2 dates):

      =IF(OR("line item date"<date1, "line item date">date2), "line item", "")

      If you can provide more details about your date structure (in what columns are dates and where are line items), I think we will get the real formula.

  4. Hi Everyone,
    Nice Day !

    All medical representative send their reports in 2 excel sheets,
    1.sales Visit – with date,product,doctors list
    2.Office Word

    now i have to compare these 2 lists and make a new report that whether they have send report or not according to names and date.

    if they send 01 mar, then i put yes
    if they not send 02 mar, then i put no

    can anyone tell me which formula can use to compare these 2 list and make it automatically “yes” and “no” according to medical rep names and dates.

    Advanced Thanks for reply

  5. it doesn´t paste all the formula.. sorry

  6. =(IF(B2=21,B2=40,B2=71,B291,"VFEL"))

  7. Hello,
    I ave a situation, i whish you can help me with: i need to work on a formula with the if funtion. i have to mark a range of values, for example: all the values are in the cell "B2"

    range: 1 - 100
    markA: 1 - 20 ( "a" )
    markB: 21 - 35 ( "b" )
    markC: 36 - 50 ( "c" )
    markD: 51 - 89 ( "d" )
    markE: 90 - 100 ( "e" )

    i have try the next formula:
    =(IF(B2=21,B2=40,B2=71,B291,"VFEL"))

    but it says the is a error, can you help out ?

    thanks

    1. Hi Ussiels,

      I am not sure I exactly understand the task, but it looks very similar to this one that can be solved using nested IFs.

      Is this what you are looking for?

  8. Hello,

    I have a due date column that is calculated at 30 days after a transfer date column. However, when I put the formula "=A1+30" in the due date column it returns a date of 01/05/1900 for rows that don't have a date entered in the transfer date column. How do I get this to stay blank unless there's a date entered in the transfer column?

    Thank you,
    Jordan

  9. Hi,
    I'm looking for a formula that will return the last value greater than 0 from a range if the cell initially referenced is equal to 0.
    Seems like it should be easy but I'm stuck on it.

    Thanks

  10. Hi,
    I want to have a formula whereby i am doing an itinerary costing. i have a start date and then dates with prices of accommodation...the dates with the price of accommodation i already have IF(B3=DATE(2015,1,1),"7500","0").....

    Now I want to have a formula where by I when the start date of the itinerary changes, then all the dates in the in the itinerary change and this change in starting date will also lead to a change on the prices.

    Thanks

  11. HI Svetlana,
    I'm trying to write a formula that returns me 'true' or 'false' depending on whether there's a £ sign in a cell with numbers, ie: £32 gives 'true', but
    €32 gives 'false.
    I've tried your:
    =IF(ISNUMBER(FIND("£",G7)),"true","false") and
    =IF(ISTEXT(FIND("£",G7)),"true","false") ,
    and both of them with SEARCH instead of FIND
    but they don't work, presumably because £ isn't text or number. I vainly tried various things like ISCHARACTER and ISSYMBOL as well....
    Hope you can help.
    Thank you.
    Geoff

  12. Hey guys - it seems as though I came to the right place...I am using excel 2007 and trying to work a formula to check cell A1 for a value of 1 and if the value of 1 is there, then insert the current date in cell A2. Please help.

  13. IN YOU TUBE I AM FEELING EASY TO UNDERSTAND ANY CONCEPT REGARDING EXCEL BUT IN GOOGLE IT IS LITTLE BIT COMPLICATED FOR ME AS BECAUSE THERE IS NO VIDEO LIKE YOUTUBE AND ALSO I AM A PLAIN GRADUATE.PLEASE DON'T MEAN IT WHAT I HAVE WROTE.I AM HAVING VERY EAGER TO LEARN EXCEL BUT I AM 35 YEARS OLD.PLEASE SEND EASY SOLVED SOLUTION OF EXCEL VIDEO IN YOUTUBE AND IN GOOGLE.

    THANKS & REGARDS

  14. Hi,

    I am trying to figure out a formula for m aging. If its a negative number then its current, if it is between 1-29 days it's "30 Days", if it is between 30-59 days "60 Days",if it is between 60-119 days "90 Days" and if it is between 120-365 days its 120 days.

    Please Help!!!!

  15. Hi Svetlana,
    I would like the next cell to represent if it is higher, lower, or equal to the previous cell. Each cell represents a total of items for a month. Ideally, it would be an up or down arrow (in green or red) for the execs to immediately identify changes.

  16. Hi,
    I need some help, I'm new to the formulation.
    I need to create a sub-production plan link to another sub-plan
    but I don't know at all how to do it.
    Example sub-production have 2 shift opening stock,need create auto plan minus current balance 2 shift with quantity issue
    I need to create a sub-production plan link to another sub-plan.
    With opening 2 shift stock, current shift auto plan which minus stock issue from opening 2 shift stock to get return of 2 shift stock and 2nd auto shift will continue, once reach to one date which no plan, so auto plan automatically stop generate plan.
    Could it be done.
    Your deliberation on helping me is much appreciate.

  17. Hi - need some help in extracting xxxx from a column that has"router bgp xxxx". xxxx varies across cells. What function can i use to extract xxxx?

    Appreciate the help in advance!!!

  18. I have a spreadsheet that has maximum number of locations in column B and and minimum number of locations in column C that a client uses as a reference when choosing services. the client seeing these number enters their desired number of locations into column D which is where the formula would be entered. Want them to be able to put in their own number that will show on the spreadsheet BUT...I do not want it to let them enter a number that is lower than the minimum or higher than the maximum. I also do not want it to say false or OK I would like the number they have added to show.

    Additionally if they try to go less than min or more than max, I would like a pop up box saying "You must enter a number that is less than the maximum and greater than the minimum number allowed"

  19. I have two columns of numbers, side by side. New numbers are loaded into the left column each day (column 1). I want to save the historical high number in a cell beside it (in column 2). If the new number in column 1 is greater than the old historical number in column 2, I want the historical nigh number in column 2 to be changed to equal the new number that came into column 1.

    How do I do that?

  20. Hello, I am not sure if what I want done is possible. I am looking to say if "apple" is in cells a2:a36 and there is an amount in cells h2:h36 then I would like it to total those amounts. Is that possible?

  21. Hi,

    I am hoping to create a formula to use in conditional formatting that would allow me to perform the following:

    I have a list of employees in column A, date in column B, and number of sales in column C.

    I am wanting to conditionally format the sales cell (in column C) as new sales data is entered. I want to compare the new sales figure against the most recent number of sales for that particular employee. With a reduction in sales of >3 formatted red.

    Your assistance is greatly appreciated.

  22. I have 3 cells (L3,M3, N3) with either true or false as responses to earlier coding but need to highlight where I get answers that are True,False, True in that order . How do I achieve this?

  23. Please Help me :
    =if(a1=2366,2355,2353 then b1 will be 120, if(a1=2377,2357,2354 then b1 will be 130)) how can i put the formula..

  24. i need to make a formula in excel to put bonus marks, for example if kevin got 25 marks he will got another 25 bonus, if he got 50 then another 25, each 25+ mark got bonus of 25... i will put only the mark on one cell and i need in the bonus mark to calculated by excel in another cell... please help

  25. =IF(F2:F152="Yes", "G3"),(F2:F152="No", "G3") returned #VALUE! What is the issue?The logic I am trying to achieveshould be if F2 thru F152 = Yes then return the name G3 and if f2 thru f152 = No return the name in column G3. Can you give me the correct formula to achieve this?

  26. Hello,

    I want to write an If then statement that takes cell contents and adds the same word to different cells. For example. suppose CELLS A3:A36 are words related to education (i.e. test, assignment homework etc...) Now suppose I want to add the word "calendar" to the words in cells A3:A36. Which would return "test calendar", "assignment calendar", "homework calendar" etc..
    How would I go about doing that?

  27. hi,
    i need help please,
    how can i add number if my result is less than 0
    example;
    =(P9-DAY(TODAY())) and i got the result -1 i dont need to see - so i wanna add 30 how can i do that

    thx

  28. Please help, I need a formula like when you subtract A1-B1 if the answer is 0.something the answer will be 0.
    Like this one: =IF (A1-B1<1,"0")

    Thank you...

  29. asskm..
    saya ingin membuat satu rumus if :
    jika A1 berisi desimal maka B1 adalah 1, jika A1 berisikan teks maka B1 adalah 0,
    mohon bantuannya untuk bisa sy membuat rumus excelnya. terimakasih..

  30. i was making employee salary sheet , i am using three rows,1st row is total hours, 2nd row is basic overs & 3rd second row is over time , our company basic hours is eight.
    Example :-

    total overs = A1=10 B1=12 C1=A .....Ext.
    Baic overs = A2=8 B2=8 C2=A ....Ext.

    Over time = A3=2 B3=4 C3=X...Ext

    iam using basic overs A2 =IF(A1=8,"8",IF(A1="A","A"))))

    A3=(=IF(A1=8,X,IF(A1=8.5,.50,IF(A1=9,"1",IF(A1=9.5,1.50,IF(A1=10,2,IF(A1="A","X"))))))

    iam using this function ,but Sundays also working overtime . i need help you Sundays hours u need over time row which function use .......... please give him the reply

  31. I request to you i make a time , using if statement =if(A110,"A-10")

    1. I request to you i make a time sheet , using if statement =if((A110,"sum(A1-10))

  32. Hello I need to use a formula that will display YES if the amount is $100 or more and remain blank if it is under $100.

    So far this is what I have =IF(B2>=100,"Yes")

  33. Not sure if this can be done. Need to search a range in A1:A20 for a text string and then return the value in the same row but 2 columns right. So for example look in A1:A20 for "Find me" and if find me is in A4 return the value that's in C4. Any ideas if this can be done?

  34. I need a formula to automatically display the current accrued PTO in a specific cell every time the excel sheet is open.
    The accrued PTO is 6.15 hours every two weeks. I have created a table with the dates and the corresponding accrued hours for reference.
    I tried IF and VLOOKUP statements but can't get the formula to work.
    Can someone suggest a formula?
    Any help will be greatly appreciated!

    Thanks,
    Raphael

  35. Hi Svetlana,
    Thanks for the great post, it helped me a lot. My case is a bit different. I want to use IF function in this way:
    IF xxx has the word "thanks" inside it, then "welcome" or "ok".
    I hope there is a way.
    Thank you.

  36. Need a formula to calculate following: if city =x zip =y. I keep getting a value error.Note I have approximately 10 cities and zips to include.
    Also need a formula stating: state always =CA

    Thanks for the help.

  37. i need some help from you.

    =IF(M9="yes", C9," ") How can i put this command in sheet 1 for the result of sheet2

  38. i am working on aproject. I need help with
    f2 contains both words and numbers. How do i display the text and numbers in 2 separate cells?

    1. got it

  39. Please help me check my error
    =if((Q339,"D"),(Q3>49,"C"),(Q3>59,"B"),(Q3>69,"A"))
    I am computing exam result

  40. Sir if my output value is 12100, 12200,12300, 12400 all value change auto 12500.
    And my out put is 12600, 12700, 12800, 12900. That value change 13000.

  41. hello sir,
    I want to know how to add a1 value.in a2, a3, a4.....
    If i change value a1,all a2, a3, a4 ...value change auto.

  42. =IF(I10-K10, IF(I10="",N10-K10, IF(ISBLANK(N10),"2")))
    the first one will be formula then the other if blank of i10 IS BLANK USE FOR N10 THEN IF N10 IS BLANK IT SHOULD BE EQUAL TO "2" THANKS
    hi how to comine this formula thanks

    1. SORI ITS N10.. THANKS

  43. Is it possible to create an IF calculation that asks a "greater than this number, but less than this number" question? i.e., if E17 is greater than 1800 or less than 2400, than perform E17-540*60%, otherwise place a zero. I get errors when I try this example...

    =IF(E17>1800<=2400, (E17-540*60%), 0)

    Thanks

  44. Hello, I have a date in cell D4, let's say 1/2003 displaying as 2003 due to custom formatting to YYYY and a formula in E4(also set to YYYY) which is D4+4385 because I want E4 to display 12 years after the date in cell D4. This formula works great if I have data in cell D4. If I don't, it will display 1912 in E4. What formula can I add to E4 to make it blank if D4 is blank without deleting the formula =D4+4385? Losing hair as we speak :/

  45. Hello sir, I'm Trying to enter Data in Sheet in form of numbers
    for example:-

    Roll-No:- 801
    Maximum Marks
    20
    20
    20
    20
    20
    20
    20
    Sig. of Class Incharge

    Roll-No:- 815
    Maximum Marks
    20
    20
    20
    20
    20
    20
    20
    Sig. of Class Incharge

    but the problem is when i try to drag or paste the same cells in another line.......Rollno has changed 814 instead of 802. My all cells are refrence cells of sheet1.

    Now which formula is best during drag or paste the rows.If i paste the row after 14 Rows ..roll no show 815 instead of 802.
    please guide me what should i do?
    if u want i can send you the copy of Sheet.
    Thanks & Regard
    Gandhi

  46. Assume that even numbered respondents (identified by RespondentID) are business travelers and odd numbered respondents are leisure travelers who travel infrequently. In column F on the surveyData tab, create a formula that identifies each respondent as either a Business traveler or Leisure traveler. You will need to use Excel’s If() function (see your Excel handbook or Excel help). Title this column travelerType. Ensure that cells F2:F501 are filled with the formula. Please help me create a formula.

  47. Hi, I need some help with this formula. A1 = $25000 B1= if(A1>0,"Total (A1)","Total"). If A1 is greater than 0, I would like B1 to show [ Total ($25,000.00) ] and if A1 = 0, I would like it to show [ Total ]. Does anyone know if this is possible?

  48. Hi Svetlana ,

    I need help with this one. I have one column lets say A1 : A38 that have some values / text . Those values can repeat themselves through A1 : A38 many times . I would like to get in another row or even sheet only one of each of those values or records.
    For Example : A1 have TB231 ; A2 TB236 ; A3 TB555 ; A4 TB555 ; A5 TB231 etc , now in separate sheet or row i should get only one of those , it dosent matter how much it has same records i just need that i get value of all different in separate sheet or row.
    Results of example should be : D1 TB231 ; D2 TB236 ; D3 TB555 , i tried with IF function but for 38 or more rows would be huge so maybe there is other easier way.

    Thank you

  49. How to check if there are 10 characters in a cell or not

  50. Is there a way to create an IF statement based on whether a number is a date? For example, If the value in A1 is a date, return the value of the date, otherwise, do nothing.

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