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 8. Total comments: 2999

  1. Hello there!
    Here is what I am trying to do:
    If text in Column D (from Workbook 1) matches text in Column E (from Workbook 2) then enter text from Column B (from Workbook 2) in Column F in Workbook 1.
    I cannot figure out how to use the vlookup function for this exercise...
    Help would be very much appreciated... thanks a lot.

    1. Hello!
      In your case, you cannot use the VLOOKUP function. When a search occurs in one data range, and you need to return data from another range, use the INDEX + MATCH functions. Read more about it here.
      If you use Office365, pay attention to the XLOOKUP function

  2. i need a formula that i want to equal first column numbers to second column texts for example firs colum 25 34 56 second column love like hate 25=love 34=like 56=hate and excel learn these equalities and i want to use them after for ex. text sheet 25034 25789 25678 34567 34897 56987 excel and i use left operation and next column 25 25 34 34 56(think that it is a column) and excel write ney column love love love like like hate

    if i use matlab it gets easier or struggle or should i use only excel
    please teach this trick
    (sorry for my bad english)

  3. Good day,

    I need to calculate data into a worksheet from specific Columns on a Mastersheet where it links back to specific Unit (Column B:B), amount of Sessions (Column D:D), but then also just for specific month (Column I:I).

    I could only manage thus far: =SUMIF(Master!B:B,CEN!B6,Master!D:D), but then how do I just get it to consider data for a specific month (Column I:I)?

  4. Dear Alexander.
    You've been more than kind, to help me before, and if it's not too much to ask, I would like to ask for your guidance ones again. I'm having a total of 30 cells (F10, F39, F68, F97, F126 and so forth) that contains the same dropbox of 8 different payment possibilities (PAGO, CARTÃO, CREDITO, DEBITO, DINHEIRO, TRANSFERENCIA, BOLETO, ASSINATURA). I'm trying to generate a formula that shows if one of more of the following 4 payment options (cartão, credito, debito, dinheiro) are listed in one or more of the 30 F-cells. For instance, if F10=BOLETO, F39="", F68=CARTÃO, F97=DINHEIRO, F126=CARTÃO... the formula would generate: "CARTÃO, DINHEIRO". Do you think you can help me with this? Sincere gratitude in advance!! Thank you!! Ronni

    1. Hello Ronni!
      Excel formula cannot work with non-contiguous cells. So you can use something like this formula

      =CONCAT(IF(INDEX(COUNTIF($G$10:$G$40,$H$10:$H$13),1)>0,"debito, ",""), IF(INDEX(COUNTIF($G$10:$G$40,$H$10:$H$13),2)>0,"credito, ",""), IF(INDEX(COUNTIF($G$10:$G$40,$H$10:$H$13),3)>0,"dinheiro, ",""), IF(INDEX(COUNTIF($G$10:$G$40,$H$10:$H$13),4)>0,"cartão",""))

      Where
      formula in G10 is =F10
      formula in G11 is =F39 ....... etc
      in H10 written "debito"
      in H11 written "credito" ... etc

      I hope this will help, otherwise please do not hesitate to contact me anytime.

  5. i just want a formula where, there is a number like 364 ,now i want to put formula to find if last 2 digit is square of some number or not , if yes thn give value true(like in this case in 364 -----64 is square of 8) nd if not no thn give value false
    example 2 :- 382 in this 82 is not a square of any number therefore valuse come should be false.

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

      =IF(SQRT(--(RIGHT(A1,2)))/INT(SQRT(--(RIGHT(A1,2))))=1,TRUE,FALSE)

      I hope it’ll be helpful.

  6. Column A = Date 30-June-2020, Column B = Date 30-Sep-2020 (*Overdue morethan 2 months)

    How to condition formatting highlight the cell in Column B in red color

    1. Hello!
      If I understand your task correctly, use this formula in a conditional formatting rule:

      =IF(EDATE(A1,2) < B1,TRUE,FALSE)

      Hope this is what you need.

  7. =if ((a1="g"),1,or(a1="mg"),1,0)
    i want 1 if a1=g and a1=mg also if a1=kg then 0 and so on.

    1. = IF(OR(D32="g",D32="mg"),1,"")

      got it Thanks

  8. Hi Alexander,
    I have a column with some digital values. I am writing an IF statement on the neighbouring column to add paranthesis around the number in the previous column.
    Ex. =IF(D10>0,[D10],0)
    Hoping that if D10 ha a value 5, the IF statement returns [5] adding the square parenthesis. But it does not. How do I fix this? Thanks!

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

      =IF(D10>0,"["&D10&"]",0)

      But at the same time, the number will be converted to text.
      You can also use a custom format without formulas.

      Please go to Format Cells, choose Number -> Custom Format and set

      \[#\];-#,##0;0

      I hope this will help

  9. Hi sir,
    Please advice me the formula
    I have three ccolumn in excel sheet - Today date ,City and Departure date.for today date i used the formula =today().but i need the formula in departure date i person is coming from same city then today date = departure date and if outside from my city then today date less one day i.e yesterday date

    1. Hello!
      Yesterday's date can be calculated using a simple formula
      =TODAY()-1
      But to give more detailed advice, I do not have the necessary information. Please describe your problem in more detail. Include an example of the source data and the result you want to get. It’ll help me understand your request better and find a solution for you. Thank you.

  10. I have a Date in B6, I want it to show a date in M6 thats 90 days out and if there is words in B6 regarding status "In installation or In permitting" I want it to be blank or show 0. Is that possible?

    1. Hello Charles!
      Do you want the formula, text and date to be in B6 at the same time? It's impossible. If I misunderstood you, explain your problem in more detail.

  11. I have 3 columns, one column showing actual costs, one row showing the estimated cost and 3rd column showing my forecasted costs. I want to write an if statement for the forecasted column that will default to the value in the estimated column if our actual costs are zero. However if we do have actual costs I want it to reflect those costs. For example
    Actual Estimated Forecast
    12 5 12
    0 10 10
    3 0 3

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

      =IF(A1=0,B1,A1)

      I hope this will help

  12. I am working on a spreadsheet relating to points (for employees). Each employees late and/or sick is recorded and they are given .5 or 1 point depending on late/sick call. After a year the employees point is removed. To keep the spreadsheet updated, there are formulas in place to change the cell to red once a year has passed. We recently made a change that the employees late will now be removed after 6 months. I need a formula that after 6 months late calls (column E), date is highlighted (column C). For the late point to be removed.
    Columns are as stated below.
    B - Employee ; C - Date ; D - Status ; E - Actual Leave (sick, late etc.) ; F - Points ; G - Total points
    Thank you in advance for your help.

    1. Hello!
      To highlight a cell with a date that happened more than 6 months ago, use the conditional formatting formula

      =EDATE(TODAY(),-6) > C1

      I hope this will help

      1. Thank you for the reply, Alex. I appreciate your guidance.
        This is a running spreadsheet that is tracked daily, with different conditional formatting rules, making it easier for dates to be tracked and points to be removed/added.
        I was hoping there was a formula to only track lates from column E, within a 6 month time frame for dates from column C. Would this need to be an IF formula inputted as a rule?
        I am hoping this makes sense.
        Thanks again for your help.

  13. Hi,

    I have a spreadsheet which has one column of company names, and one column of numbers. There is a table at the bottom, what I need is for one line in the table to add all of the number cells for each company name? They are in date order so the company names are not in alphabetical order.

    How can I do this?

    Thanks,

  14. Hi,
    If my company is giving me salary on every mid month and month end basis (Eg. 15 and 30 or 31 (depend on month end date) / for Feb month 28 or 29).every fortnight i received the 10000 dollar.But suppose i am leaving the company on 12-06-2020 then how much amount i will get?
    I need advance formula where we can drag the formula and take it out the amount for other employee details also.
    E.g.
    Leaving date Amt
    12-06-2020 10000
    26-02-2020 10000
    please let me know if additinal details required.

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

      =IF(DAY(A11) < = 15,DAY(A11)/15,(DAY(A11)-(DAY(EOMONTH(A11,0))-15)) / (DAY(EOMONTH(A11,0))-15))*10000

      I hope it’ll be helpful.

  15. Hello~
    I have a birth date in one cell (example 7/22/15), and I need to another cell to auto populate the age in years based on the date 9/1/20. The value would be 4, but what would be a formula to populate that automatically?

    1. In addition, I need the number to come out to a whole number that isn't rounded up.

  16. Hi,
    i need help with a formula
    If column "M" is less than £3.50 then it needs to say £3.50 and if its higher than £3.50 it needs to return the value stated in column "M"
    =IF(M5<3.49,"£3.50","M5")
    My formula is this so far but the higher value is saying M5 instead of the values higher than £3.50

  17. IF MY CELL CONTAINED #N/A FROM A VLOOKUP VALUE HOW TO PUT 0

  18. Good day,
    I am trying to create an 'If' formula for tasks that picks up a range from another sheet and returns the result on a summary tab.I am not sure if 'IF' is the correct formula as I can't get it to work.

    If C38:C42 (on the detailed tab) status is completed then return the text 'Completed, if FALSE then return 'To Complete' on the Summary tab.

    I have tried =IF(Revals!C38:C39="Complete","Completed","To Complete") but it didn't work.

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

      =IF(IFERROR(MATCH("Complete",C38:C39,0) > 0,0),"Completed","To Complete")

      I hope this will help, otherwise please do not hesitate to contact me anytime.

      1. Thanks Alexander. I tried it but when I change the status it still returns the same value as if completed. Meaning, if I then went to the detailed tab and changed the cells one to complete and the other to to be completed, it still gives me a result on the summary page that the tasks have been completed when it hasn't.

        On the positive at least it is returning a value, i could not get it to even do that :-)
        Thanks

        1. Hello!
          I expected that you pay attention to the fact that my formula does not have such cell references as yours. I do not have your workbook, so the links may not be the same. I think you just copied the formula and now want it to work? I have given you a sample. Use your cell references in it.

          1. Hi Alexander, yes I changed to my cell references to pick up from the separate tab. However with me putting one as Complete and the rest as To complete, it still returned a value of Completed

            1. Hello!
              I wrote this formula based on the description you provided in your original comment. But now it’s clear that you didn’t say everything. How many cells in your range? 2 or more? There were 2 of them in your formula. But now, according to your words, I see that this is not so. Do you need at least 1 match or matches in all cells? The formula you wrote speaks of one coincidence. Now is this not so? Please note that if you’d provided me with the precise and detailed description of your task from the very beginning, I’d have created a different formula that would have worked for your case.

              1. Sure, thank you for you help.
                It will be ranges of cells in one column. In this particular example, there are 5 rows in the column. The user is required to change the status to either Completed or Not completed. This is on the detailed tab. There are about 5 different headings with a range of tasks in each one. So I wanted to create a summary sheet that will then Look at each area and then return a result. If all tasks are not completed, even if only one tassks is the summary sheet should say not completed for that particular area. Eg below

                Sales
                Column B Column C
                Row 23 Payroll Reval Not Completed
                Row 24 Orders Reval Not Completed
                Row 25 Bank Reval Completed
                Row 26 Tax Reval Not Completed
                Row 27 Interco Reval Completed

                I hope this clarifies a bit

  19. Could some one help, please? I am trying to analyse the sales data for a new housing development. I have set up a table with my raw data for the 126 properties, with the following columns:

    A = Street number
    B = Street address
    C = developer’s plot number
    D = developer’s house type name (in text)
    E = developer’s house type code number (mix of numbers and letters)
    F = number of bedrooms the house has
    G = whether the house is a flat/terraced/semi-detached/detached
    H = size of house (ft2)
    I = sale price
    J = date of sale
    K = sale price/ft2

    I am trying to consolidate the raw data into a second table in the same worksheet so that I can calculate the average selling price for the 22 different house types. I find that if I sort the raw data table on house type name to group each house type together and then use the AVERAGE function In the consolidated table, when the raw data is then resorted on a different parameter (say street name) the data pull through for the average is the new cell content rather than the original cell content (ie the cell reference remains the same rather than changing to follow the original data). I have tried to set up a logic test (=IF(D5:D130)=D135,AVERAGE(I5:I130), ) where the range D5:D130 is the range of house type names in the raw data table, D135 is the specific house type name in the consolidated data table, and I5:I130 is the selling price in the raw data table. All I get is an error, either #VALUE! or #NAME! if I try fiddling with the logic test set up. What am I doing wrong?! Can anyone help, please?

      1. Thank you. It worked! Much appreciated. Gold star!

  20. Hi,
    How do I, if condition met, the cell equals to the value of another cell?
    For example;
    Cell C4 is empty. If the formula in cell U2 generate a '1', the value of C4 will automatically be equal to the value stated in cell R2.
    By the way, the value in cell R2 is 'A,B,C,D'.
    Please advise and thank you.

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

      =IF(U2=1,R2,"")

      I hope it’ll be helpful.

  21. Hi,
    I could use some help please.
    I have 3 variables that depend on the last letter of the main word and I would like to separate them as follows:
    XXXXXXA Yesterday
    XXXXXXD, XXXXXXXE, XXXXXXF Today
    XXXXXXK, XXXXXXL, XXXXXXM, XXXXXXN Tomorrow
    If try IF, OR, ISNUMBER SEARCH AND FIND but I can’t figure it out.
    So I just want it to write ‘Yesterday’ if last letter A, ‘Today’ if D,E or F and ‘Tomorrow’ if K, L, M or N as last letter.
    Thanks

    1. Hello Matea!
      If I understand your task correctly, the following IF formula with nested IF conditions should work for you:

      =IF(SUM(--(RIGHT(N1,1)={"K","L","M","N"}))>=1,"Tomorrow", IF(SUM(--(RIGHT(N1,1)={"D","E","F"}))>=1,"Today", IF(RIGHT(N1,1)="A","Yesterday","")))

      I hope this will help

  22. Dear Alexander,
    You've been so kind to help me with the following formula: =IF(OR(B35"";C35"";D35"");CONCATENATE(B35+C35+D35;"x ";C28);"")
    Would you be so kind to also guide me on how to include a second IF-formula (just with following cells B56, C56 and D56 with the name from cell C49? Preferably separated with a comma between the formulas, so the output would look like e.g.: 5x Ronni, 2x Alexander
    I've tried with following =IF(OR(B35"";C35"";D35"");CONCATENATE(B35+C35+D35;"x ";C28);IF(OR(B56"";C56"";D56"");CONCATENATE(B56+C56+D56;"x ";C49);"")) but I can't get it to work.
    Once again, thank you very much for your kind help!!
    Ronni

    1. Hello Ronni!
      You just need to add another formula with the condition

      =IF(OR(B13<>"",C13<>"",D13<>""), CONCATENATE(B13+C13+D13,"x ",C7),"") & ", " & IF(OR(B35<>"",C35<>"",D35<>""), CONCATENATE(B35+C35+D35,"x ",C28),"")

      I hope it’ll be helpful.

      1. Dear Alexander! Thank you very much for your answer and time. I'm not really sure why, but the output of the cell ends up only calling the first IF formula (C7 without C28). I've checked all the cells, made sure that they aren't empty. If I change the order of the two formulas, it calls (C28 without C7). And I'm not getting any error messages on the formula. Do you have any idea why that can be? Once again, thank you for your time!!

        =IF(OR(B13"",C13"",D13""), CONCATENATE(B13+C13+D13,"x ",C7),"") & ", " & IF(OR(B35"",C35"",D35""), CONCATENATE(B35+C35+D35,"x ",C28),"")

        1. Hello Ronni!
          In my Excel workbook, the formula works. There are no ideas other than copy error.
          Try a different version of this formula, where instead of the & operator, the CONCATENATE function is used

          =CONCATENATE(IF(OR(B13<>"",C13<>"",D13<>""), CONCATENATE(B13+C13+D13,"x ",C7),""),", ",IF(OR(B35<>"",C35<>"",D35<>""), CONCATENATE(B35+C35+D35,"x ",C28),""))

  23. I have a data from an ERP system which gives the amount with a symbol suffix 'Dr' for debit balance, and a 'Cr' for a credit balance. I want to capture the debit balances as a positive value and the credits with a negative value. Please help

    1. Hello Thomas!
      I do not know how your values are written. You did not say anything about this. The IF function will not help here. But I think that you’ll find this formula useful

      =IFERROR(VALUE(SUBSTITUTE(A20,"Dr","")), -VALUE(SUBSTITUTE(A20,"Cr","")))

      I hope this will help, otherwise please do not hesitate to contact me anytime.

  24. Hi,
    My scenario is the following: if a date is more than 3 years old then Good...if is less than 3 years Not Good. For example if 04/17/2016 is more than 3 years old from 01/01/2020. Thanks.

    1. Hello Chris!
      To calculate the difference between dates, use the DATEDIF function. I recommend this article. Use DATEDIF with the Y parameter as a condition in the IF function.
      I hope this will help, otherwise please do not hesitate to contact me anytime.

  25. Are you able to create an IF then statement in excel and embed another function formula?
    Example:
    Column A2 contains a start date and time: 5/15/20 14:15.
    Column B2 contains an end date and time: 5/16/20 08:09.
    Column C2 contains a formula to caculate the duration between columns A and B in minutes: TEXT(B2-A2), "[mm]".
    I am looking for a formula where blanks will appear in column C2 if column A2 is not yet populated. I want to include the TEXT formula throughout column C, in order to auto populate the column C once columns A and B have data. Currently, using the formula TEXT(B2-A2), "[mm]" yields 00 in column C2 if A2 is blank.
    I tried the following formula, but cannot get it to work: If A2>0, TEXT(B2-A2,"[mm]", " " Explanation: If nothing is in column A, column C should be blank (i.e. not show 00). Thanks in advance for your assistance.

    1. Hello Joe!
      Use the IF function with two conditions

      =IF(AND(A2<>"",B2<>""), TEXT(B2-A2,"[mm]")," ")

      If there is anything else I can help you with, please let me know.

  26. Hi. I am trying to create a formula that says:
    If (a1 =1 then c1 = 50) ( a1= 2 then c1 = 60) (a1= 3 then c1 = 70) (a1 = 4 then c3 = 10)
    Thanking you in advance.

    1. Hello Jeff!
      A formula can only set a value in the cell in which it is written. The formula in C1 cannot change cell C3.Therefore, I assume that C3 is a mistake. Change C3 to C1. The formula in C1 is

      =IFERROR(CHOOSE(A1,50,60,70,10),"")

      Or use the If function

      =IF(A1=1,50,IF(A1=2,60,IF(A1=3,70, IF(A1=4,10, "") ) ) )

  27. Hi,

    Could you please help me? I have column J as text - apple;orange;bananas;vegetables (spinach, fenugreek, etc); acai berry. I want to create Column K as 1 if there is orange in Column J and 0 if not OR 1 if there is spinach in Column J and 0 if not. How can I do that? Please advise. Thank you for your help!

    1. The formula will return 1 if there is "orange" in column J.

      =IF(COUNTIF(J:J,"orange") > 0,1,0)

      Hope this is what you need.

      1. Hi Alexander,
        Thank you for your help but unfortunately the formula did not work. Just to clarify each row in J has continuous text such as Row 1 = apple;orange;bananas;vegetables(spinach,fenugreek,etc);acai berry
        Row 2 = orange;bananas;vegetables(spinach,fenugreek,etc)
        Row 3 = apple;orange;bananas
        and so on
        Also there is no space between the text and semi colon and following text
        Please advise

        1. Hello!
          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 also assume that the phrase "each row in J has continuous text" actually means "every cell in column J contains text."
          Try the following formula:

          =IF(IFERROR(SEARCH("orange",J2,1),0)>0,1,0)

          After that you can copy this formula down along the column.

  28. Hi,
    Let say i have text "export" in C2 and C20 . Can I use formula =if(C2=C20,countifxxx,0) ?
    So if I want to change the text 'export' I don't need change every formula. is that possible?
    thanks to advice.

    1. Hello!
      In your IF formula, it is important that C2 = C20. What will be recorded in these cells does not matter. You can use nested functions as a TRUE or FALSE condition, including COUNTIF.

  29. There are payroll list for June 2020
    1) Fill June Payoff with this rule: if monthly Wage is less then 20 000, then pay 20 000. In other case pay just Wage itself.
    What value should put in Value _if_ false

  30. Hi Alexander!
    Thank you for a great and helpful site!! I have three cells (B13, C13, and D13) that can contain numbers (usually nothing or somewhere between 1 to 10). If one (or more) of these three cells contain a number (if none of them are empty), I would like to extract a name that is written in cell C7 - and with the sum of the three cells (B13, C13 and, D13) listed with an "x" before the name. Example: B13 [1], C13 [empty], D13 [5], C7 [Ronni] - would generate: "6x Ronni". Is this possible to make? Thank you very much for your help!!

    1. Hello Ronni!
      Please use the following formula

      =IF(OR(B13<>"",C13<>"",D13<>""),CONCATENATE(B13+C13+D13,"x ",C7),"")

      I hope this will help, otherwise please do not hesitate to contact me anytime.

    2. Sorry, let me correct my question:
      I have three cells (B13, C13, and D13) that can contain numbers (usually nothing or somewhere between 1 to 10). IF one (or more) of these three cells contains a number, I would like to extract a name that is written in cell C7 - and with the sum of the three cells (B13, C13 and, D13) listed with an "x" before the name. Example: B13 [1], C13 [empty], D13 [5], C7 [Ronni] - would generate: "6x Ronni".

  31. If A+ then "Outstanding"
    If A then "Excellent"
    If B+ then "Very Good"
    If B then "Good"
    If C+ then "Satisfactory"
    If C then "Acceptable"
    If D+ then "Partially Acceptable"
    If D then "Insufficient"
    If E then "Very Insufficient"
    For this condition I used "=IF(N7, IF(N7="A+", "Outstanding", IF(N7="A", "Excellent", IF(N7="B+", "Very Good", IF(N7="B", "Good", IF(N7="C+", "Satisfactory", IF(N7="C", "Acceptable", IF(N7="D+", "Partially Acceptable", IF(N7="D", "Insufficient", "Very Insufficient")))))))))" but it show "VALUE!".
    Pls Help me

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

      =IF(N7="A+","Outstanding",IF(N7="A","Excellent", IF(N7="B+","Very Good",IF(N7="B","Good", IF(N7="C+","Satisfactory",IF(N7="C","Acceptable",IF(N7="D+","Partially Acceptable", IF(N7="D","Insufficient","Very Insufficient"))))))))

      I hope it’ll be helpful.

  32. Would it be possible to use an IF statement, to say if a cell is still empty after a date has passed the "True" would be "OK" and "False" would be "Late"?

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

      =IF(AND(B2 > A2,C2=""),"OK","Late")

      I hope this will help, otherwise please do not hesitate to contact me anytime.

  33. Hi,
    could you please help.
    I am trying to find a way to do this using an IF statement that would do the following: IF(A=B,C,do nothing), in other words if the condition A=B, is true, put the value C in the cell, else if the condition fails, leave the old value in the cell. There is a way to do this in Excel but I haven't been able to find. Instead I have to manually open each report sheet and do a copy and paste from where the report I receive.

    1. Hello Bewar!
      If a value is already written in the cell, then it is no longer possible to write the formula into it. The Excel function can’t change values in other cells, it returns a value only in a cell where it is written. You'd better use VBA to solve your task.

  34. Hi,
    what a good and clear explanations on the website, credits to the maker. however i am not an excel expert and still cant figure out how to move on with what i want
    i have 2 check boxes 1 in H4 (with comment 12hrs) and 1 in I4 (with comment 24hrs)
    now i want in the mergedbox below H/I 5 to appear a text when checking one of the boxes
    if box H4 is checked i want to see 1 x operator
    if box I4 is checked i want to see 2 x operator
    every time i try to make an if formula excel gives an error that i start a formula and i need to put an ' before the text. can you please help me :)
    thanks in advance,
    regards kasper,

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

      =IF(H5=TRUE,1*H9,IF(I5=TRUE,H9*2,H9))

      I don’t understand what “operator” is, so I replaced it with H9.
      Hope this is what you need.

      1. unfortunately its not working, 1x operator is just the text I want to show in cell H5
        so like they only need one person for 12 hours work or 2 persons for 24 hours of work

  35. Hi,
    Good morning to all of you.
    Please suggest me a formula.
    =if(A1>=10,"Same Value of A1", if(A1<10, "Please Put One Zero Before Value of A1"))

    1. Hello Praveen!
      Unfortunately, you did not write what result you wanted to receive. Perhaps your formula should be written as follows:

      =IF(G2> = 0.5 * C2, "APPROVE", "DISAPPROVE")

      Hope this is what you need.

  36. Hi, I've been reading your article and i must say it's outstanding. However though it was useful in some areas I still found myself stuck.
    I've been trying to insert an if function
    =If(G2>=0.5,C2,"APPROVE", "DISAPPROVE")
    But its not working
    Any Help is appreciated

    1. Hello Cresia!
      Unfortunately, you did not write what result you wanted to receive. Perhaps your formula should be written as follows:

      =IF(G2> = 0.5 * C2, ”APPROVE”, “DISAPPROVE”)

      I hope my advice will help you solve your task.

  37. Thanks for the article.
    I need help with writing out a formula that says, if column B = yes and column C = yes, then D should say True.
    So far I tried:
    =IF(B2="YES",TRUE(IF(C2="YES",TRUE),False))

    Looking forward to hearing from you.

    Rgs

  38. Hi
    I would like to return a value to be 1 if the division of the two cell equals or greater than 1 and .5 if it's less than 1
    =if(c5/d5>="1","1",".5")
    I inputted the formula above but it's not showing the proper value..
    Hope it makes sense. Much appreciated, ty!!

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

      =IF(C5/D5 >= 1,1,0.5)

      I hope this will help

  39. Hello
    I am struggling with an IF formula, hopefully i have explained it clear enought.

    I want to return a value to cell V1 (the cell i am entering the formal into), if the value of cell U1 is greater than 0.1. The value i want to return is in cell T1, if the value is less than 0.1, i want to return a value of 0.

    Any help would be much appreciated

    Thank-you

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

      =IF(U1 > 0.1,T1,0)

      I hope this will help

  40. Hello,
    I am struggling with my nested IF formula. I am trying to return a "Y" or "N" if the given date meets certain requirements but sometimes strings of text can be found in the cell. If the string of text matches I would like it to return "N" or "Y" based off the requirements. Any help would be greatly appreciated.

    =IF(EDATE(A5,12)<TODAY(),"N",IF(A5TODAY()+30,OVERDUE,IF(SEARCH("OVERDUE",A5),"N","Y"))))

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

      =IF(EDATE(A5,12)

  41. Hello,

    I have some dates in column K that I periodically add to or update, also some blanks that don't have dates added yet. I would like a formula for column L that gives dates 6 months in the future if there is a date in column K. However, if there is no date (blank cell) in column K, I would like the corresponding L cell to remain blank until a date in inputted into the K cell. Hope that makes sense! I appreciate any help.

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

      =IF(K1 <> "",EDATE(K1,6),"")

      After that you can copy this formula down along the column.
      Hope this is what you need.

  42. I cant find what the problem is with this simple thing
    =IF(BASE!MONTH=ENGINE!B1,"yes","No"

    1. Hello Herman!
      You did not indicate exactly which error occurs in your formula. However, MONTH is a function and cannot be a link. Therefore, BASE! MONTH does not make sense and is a mistake.
      The formula lacks the brackets at the end.
      If you give more complete information, perhaps I can still suggest something else.

  43. I have a row of cells which have values in for lab results - I can't figure out a formula to work out a minimum value where values are either numbers or come as say <0.05 etc. i.e where they are less than the laboratories limit of detection (<LOD). I want the minimum number so i want it to register that <0.05 is less than 0.06 either through the presence of a less than symbol or any other way. I tried to play around with any cell being greater than 0 calculate a minimum and for where cells do not to populate as"<LOD". i.e. 1.9 , < 0.05, 0.29 would return a minimum of "<LOD". 1.9, 0.06, 0.29 would return a minimum of 0.06 and < 0.05 < 0.05 < 0.05 would return a minimum of "<LOD". Any help would be greatly appreciated - I can't find any examples where you have an if statement followed by a function if the statement is true, and to present a text value if not ("<LOD").

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

      =IF(NOT(ISERROR(MATCH("<*",A7:A15,0)>0))," < LOD",MIN(A7:A15))

      I hope this will help, otherwise please do not hesitate to contact me anytime.

      1. Hi Alexander,
        Thank you for your time - this seemed to work perfectly. Is there a way to do the same for the max, i.e highest number or <LOD if all are less than detection. I've tried playing around with the formula to try for max but can't get it to work for all cases. Please could you assist. Thanks again.

  44. I have a row, the 'amount' row, containing numerical figures from about 100 to about 1000000. I need a formula that will put corresponding figures in another cell. For example if the figures In the 'amount' row are greater than 100 and less than 5200, 100 should go to the cells beside the "amount" row, which I'll call the 'charge' row. And if the cells contains figures greater than 5,200 and less than 10300, then 200 should be in the 'charge' row, so that at the end, I can calculate the total charge for every single amount figure.

  45. I am looking for a help finding a formula

    If cell A1 is a negative number it will turn to a positive number and if cell A1 is a positive number it will turn to a zero.

    1. Hello Vincent!
      If a number is written in the cell, Excel can only change it using VBA. An Excel formula can only change the value of the cell in which it is written. But if a number is written in the cell, then you will not be able to write the formula into it.
      The formula in cell B1 might look like this:

      =IF(A1 < 0,-A1,0)

      I hope it’ll be helpful.

  46. I'm having trouble using the IF logic statement- here it is =IF(C2=7592.00,1251.80,0. What Im trying to say is if the value in C2 is (7592.00) if true input 1251.80, if false input 0.
    C2 actually does not contain 7592.00. Its referencing and reading a value from another cell in a different sheet. ='DRP Implementation'!N127 Result is Im not getting the result I want 1251.80 if 7592.00 is present. Is it because C2 is a ref cell and not a discrete numerical value? How would you correct this?

    1. Hello Larry!
      First off, please check your Excel settings: Excel - File - Options - Advanced - Update links to other documents. Also, please go to Data->Edit Links and make sure the autoupdate for each link is enabled.
      Check the automatic calculation in your Excel. Go to File -> Options -> Formulas -> Calculation Options and switch to Automatic option there.
      Note! In this case, you'll need to hit Shift+F9 to recalculate the formulas in any workbook you're working with.
      Hope it'll help, otherwise please do not hesitate to contact me back.

  47. Hi! I am trying to create a complicated If Then statement and haven't had success. Could you help?
    If the text in a cell says "Participant #1", then I want it to tell me the name which is found in cell C2. But if the text says "Participant #2" then I want it to tell the name in cell D2. And so on through to Participant #4. If there is no text then leave it blank.

    =IF("Participant #1",E2, IF("Participant #2",F2, IF("Participant #3",G2, IF("Participant #4",H2,"")))
    This is what I had, but is saying I cannot coerce my formula into a boolean equation... what on earth?

    Thank you so much for help!

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

      =IF(B1="Participant #1",F2, IF(B1="Participant #2",G2, IF(B1="Participant #3",H2, IF(B1="Participant #4",I2,""))))

      Hope this is what you need.

      1. I ended up having to use this sequence, which I got from an excel whiz that I happened to connect with through a friend:

        =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(K2, "Participant #1", $E2 & " " & $C2), "Participant #2", $F2 & " " & $C2), "Participant #3", $G2 & " " & $C2), "Participant #4", $H2 & " " & $C2)

        K2 is the cell of the activity participants, E2 / F2, etc. are the Participant First Names, and C2 is the last name

  48. Hi,
    Wondering if someone can please help me with a formula?
    If column G contains the text "Yes", then I want column I to generate a sequential number, starting at 001. If G contains "No", then no number is to be generated and the cell will remain blank, and the next sequential number (002) will appear the next time column G contains "Yes"
    I understand the IF function, but am struggling with the numbering part.
    So far I have =IF(G:G="Yes","*","")- I need to fill in the * part!
    Thanks :)

    1. Hello Amy!
      Please try the following formula:

      =IF(G1="Yes",COUNTIF($G$1:G1,"Yes"),"")

      After that you can copy this formula down along the column.
      Please go to Format Cells, choose Number -> Custom Format and set
      00#
      Or instead of the number in the cell, you can write text and not use custom format:

      =IF(G1="Yes",TEXT(COUNTIF($G$1:G1,"Yes"),"00#"),"")

      I hope this will help

  49. hello,
    I wanted to put a date in one cell then it will populate in other cell. for example if I put a date in A1, whatever I put in A1 should populate in A3, A5, and A7. If I put a date in A3 then it will populate in A1, A5, and A7. If I put a date in A5 then it will populate in A1, A3, and A7. If I put a date in A7 then it will populate in A1, A3, and A5. Hope you can help me with this. Thank you

    1. Hello Winterstory!
      Please note that a cell may contain either a value or a formula. Since it is unknown which of your cells should be filled with data, which should be auto-populated by the formula, your task can be accomplished with the help of VBA only.

  50. I select a date from cell Q33 ( 04-May-2020), and in cell R33 add some duration to it from either P34, or Q34 and or R34 (Year, month and day respectively). In this case 0 years (P34), 0 months (Q34), 200 days (R34) which gives me 16-Nov-20 in R33. The date so arrived at in R33 should not be greater than year end date i.e, 31-Mar-21. If it exceeds it should return FALSE in R33, if not it should return the correct date.
    I tried following formula, but it does not work. Please help.

    =IF(DATE(YEAR(Q33)+P34,MONTH(Q33)+Q34,DAY(Q33)+R34)>(DATE(YEAR(Q33)+(Q33>DATE(YEAR(Q33),3,31)),3,31),"FALSE",(DATE(YEAR(Q33)+P34,MONTH(Q33)+Q34,DAY(Q33)+R34))

    Thanks in anticipation.

    1. Hello Mahesh!
      The formula you wrote does not work. I don’t quite understand why you have the end of the year - March 31. May 4 plus 200 days is November 20, and not November 16, as you have.
      I suggest using the formula

      =IF(DATE(YEAR(Q33)+P34, MONTH(EDATE(Q33,Q34)),DAY(Q33))+R34 > R33,Q33,DATE(YEAR(Q33)+P34,MONTH(EDATE(Q33,Q34)),DAY(Q33))+R34)

      where R33 is the end date of the year.

      1. Hello Alexander!
        This is used for calculating interest on investment starting and ending in same Fin. Year (FY).
        We have FY starting 1 April and ending 31 March e.g., 1-Apr-20 to 31-Mar-21.
        Thus tenure can be max 1 year or less than 12 months or less than 365 days or in months and days.
        Starting date (Q33) is always =TODAY() and cell is locked, but end date (R33) can not be more than 31-March of FY. Thus if tenure input (P34 Y, Q34 M, R34 D) given is such that end date goes beyond 31-March cell (R33) must return "FALSE".
        First part of formula has to add tenure to start date, > (THEN) part of formula has to find FY end date using start date, and (else) part has to either give end date or if more than FY end date return FALSE.
        Tried your suggestion, but it seeks >#REF! as follows: =IF(DATE(YEAR(Q33)+P34, MONTH(EDATE(Q33,Q34)),DAY(Q33))+R34>#REF!,Q33,DATE(YEAR(Q33)+P34,MONTH(EDATE(Q33,Q34)),DAY(Q33))+R34). This is because formula is being built in cell R33 so it cannot have input >R33
        Kindly suggest.
        Thanks.

        1. Hello Mahesh!
          I copied the formula from a blog in Excel and made sure that it works. Perhaps the error #REF! caused by incorrect copying. To make the formula fit your needs, use

          =IF((EDATE(Q33,Q34+P34*12)+R34) > DATE(2021,3,31),FALSE,EDATE(Q33,Q34+P34*12)+R34)

          1. Hello Alexander.
            This formula works.
            But, I would request you to help make year change automatic i.e., there should be no need to change (2021,3,31) with every FY change in >DATE(2021,3,31) e.g. if date next year is 09-May-2021 it should become >DATE(2022,3,31). Please suggest replacement of Date(2021,3,31) with a formula to achieve it.
            Thanks.

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