Nov
26

Using IF function in Excel: formulas for numbers, text, dates, blank cells

The IF function is one of the most popular and useful functions in Excel. You use the IF function to ask Excel to test a condition and to return one value if the condition is met, and another value if the condition is not met.

In this tutorial, we are going to learn the syntax and common usages of Excel IF function, and then will have a closer look at formula examples that will hopefully prove helpful both to beginners and experienced Excel users.

Excel IF function - syntax and usage

The IF function is one of Excel's logical functions that evaluates a certain condition and returns the value you specify if the condition is TRUE, and another value if the condition is FALSE.

The syntax for Excel IF is as follows:

IF(logical_test, [value_if_true], [value_if_false])

As you see, the IF function has 3 arguments, but only the first one is obligatory, the other two are optional.

  • logical_test - a value or logical expression that can be either TRUE or FALSE. Required.In this argument, you can specify a text value, date, number, or any comparison operator.

    For example, your logical test can be expressed as or B1="sold", B1<12/1/2014, B1=10 or B1>10.

  • value_if_true - the value to return when the logical test evaluates to TRUE, i.e. if the condition is met. Optional.

    For example, the following formula will return the text "Good" if a value in cell B1 is greater than 10: =IF(B1>10, "Good")

  • value_if_false - the value to be returned if the logical test evaluates to FALSE, i.e. if the condition is not met. Optional.

    For example, if you add "Bad" as the third parameter to the above formula, it will return the text "Good" if a value in cell B1 is greater than 10, otherwise, it will return "Bad": =IF(B1>10, "Good", "Bad")

Excel IF function - formula example

Excel IF function - things to remember!

Though the last two parameters of the IF function are optional, your formula may produce unexpected results if you don't know the underlying logic beneath the hood.

  1. If value_if_true is omitted.

    If the value_if_true argument is omitted in your Excel IF formula (i.e. there is only a comma following logical_test), the IF function returns zero (0) when the condition is met. Here is an example of such a formula: =IF(B1>10,, "Bad")

    If you don't want your IF formula to display any value when the condition is met, enter double quotes ("") in the second parameter, like this: =IF(B1>10, "", "Bad") Technically, in this case the formula returns an empty string, which is invisible to the user but perceivable to other Excel functions.

    The following screenshot demonstrates the above approaches in action, and the second one seems to be more sensible:
    IF formulas with the value_if_true argument omitted

  2. If value_if_false is omitted.

    If you don't care what happens if the specified condition is not met, you can omit the 3rd parameter in your Excel IF formulas, which will result in the following.

    If the logical test evaluates to FALSE and the value_if_false parameter is omitted (there is just a closing bracket after the value_if_true argument), the IF function returns the logical value FALSE. It's a bit unexpected, isn't it? Here is an example of such a formula: =IF(B1>10, "Good")

    If you put a comma after the value_if_true argument, your IF function will returns 0, which doesn't make much sense either: =IF(B1>10, "Good",)

    And again, the most reasonable approach is to put "" in the third argument, in this case you will have empty cells when the condition is not met: =IF(B1>10, "Good", "")
    IF formulas with the value_if_false argument omitted

  3. Get the IF function to display logical values TRUE or FALSE

    If you want your Excel IF formula to display the logical values TRUE and FALSE when the specified condition is met and not met, respectively, type TRUE in the value_if_true argument. The value_if_false parameter can be FALSE or omitted. Here's a formula example:

    =IF(B1>10, TRUE, FALSE)
    or
    =IF(B1>10, TRUE)
    an example of the IF function that displays logical values TRUE or FALSE

    Note. If you want your IF formula to return TRUE and FALSE as the logical values (Boolean) that other Excel formulas can recognize, make sure you don't enclose them in double quotes. A visual indication of a Boolean is middle align in a cell, as you see in the screenshot above.

    If you want to "TRUE" and "FALSE" to be usual text values, enclose them in "double quotes". In this case, the returned values will be aligned left and formatted as General. No Excel formula will recognize such "TRUE" and "FALSE" text as logical values.

  4. Get IF to perform a math operation and return a result

    Instead of returning certain values, you can make your IF formula to test the specified condition, perform a corresponding math operation and return a value based on the result. You do this by using arithmetic operators or other Excel functions in the value_if_true and /or value_if_false arguments. Here are just a couple of formula examples:

    Example 1: =IF(A1>B1, C3*10, C3*5)

    The formula compares the values in cells A1 and B1, and if A1 is greater than B1, it multiplies the value in cell C3 by 10, by 5 otherwise.

    Example 2: =IF(A1<>B1, SUM(A1:D1), "")

    The formula compares the values in cells A1 and B1, and if A1 is not equal to B1, the formula returns the sum of values in cells A1:D1, an empty string otherwise.

Using the IF function in Excel - formula examples

Now that you are familiar with the Excel IF function's syntax, let's look at some formula examples and learn how to use IF as a worksheet function in Excel.

IF function examples for numbers: greater than, less than, equal to

The use of the IF function with numeric values is based on using different comparison operators to express your conditions. You will find the full list of logical operators illustrated with formula examples in the table below.

Condition Operator Formula Example Description
Greater than > =IF(A2>5, "OK",) If the number in cell A2 is greater than 5, the formula returns "OK"; otherwise 0 is returned.
Less than < =IF(A2<5, "OK", "") If the number in cell A2 is less than 5, the formula returns "OK"; an empty string otherwise.
Equal to = =IF(A2=5, "OK", "Wrong number") If the number in cell A2 is equal to 5, the formula returns "OK"; otherwise the function displays "Wrong number".
Not equal to <> =IF(A2<>5, "Wrong number", "OK") If the number in cell A2 is not equal to 5, the formula returns "Wrong number "; otherwise - "OK".
Greater than or equal to >= =IF(A2>=5, "OK", "Poor") If the number in cell A2 is greater than or equal to 5, the formula returns "OK"; otherwise - "Poor".
Less than or equal to <= =IF(A2<=5, "OK", "") If the number in cell A2 is less than or equal to 5, the formula returns "OK"; an empty string otherwise.

The screenshot below demonstrates the IF formula with the "Greater than or equal to" logical operator in action:
the IF formula with the

Excel IF function examples for text values

Generally, you write an IF formula for text values using either "equal to" or "not equal to" operator, as demonstrated in a couple of IF examples that follow.

Example 1. Case-insensitive IF formula for text values

Like the overwhelming majority of Excel functions, IF is case-insensitive by default. What it means for you is that logical tests for text values do not recognize case in usual IF formulas.

For example, the following IF formula returns either "Yes" or "No" based on the "Delivery Status" (column C):

=IF(C2="delivered", "No", "Yes")

Translated into the plain English, the formula tells Excel to return "No" if a cell in column C contains the word "Delivered", otherwise return "Yes". At that, it does not really matter how you type the word "Delivered" in the logical_test argument - "delivered", "Delivered", or "DELIVERED". Nor does it matter whether the word "Delivered" is in lowercase or uppercase in the source table, as illustrated in the screenshot below.
Case-insensitive IF formula for text values

Another way to achieve exactly the same result is to use the "not equal to" operator and swap the value_if_true and value_if_false arguments:

=IF(C2<>"delivered", "Yes", "No")

Example 2. Case-sensitive IF formula for text values

If you want a case-sensitive logical test, use the IF function in combination with EXACT that compares two text strings and returns TRUE if the strings are exactly the same, otherwise it returns FALSE. The EXACT functions is case-sensitive, though it ignores formatting differences.

You use IF with EXACT in this way:

=IF(EXACT(C2,"DELIVERED"), "No", "Yes")

Where C is the column to which your logical test applies and "DELIVERED" is the case-sensitive text value that needs to be matched exactly.
Case-sensitive IF formula for text values

Naturally, you can also use a cell reference rather than a text value in the 2nd argument of the EXACT function, if you want to.

Note. When using text values as parameters for your IF formulas, remember to always enclose them in "double quotes".

Example 3. IF formula for text values with partial match

If you want to base your condition on a partial match rather than exact match, an immediate solution that comes to mind is using wildcard characters (* or ?) in the logical_test argument. However, this simple and obvious approach won't work. Many Excel functions accept wildcards, but regrettably IF is not one of them.

A solution is to use IF in combination with ISNUMBER and SEARCH (case-insensitive) or FIND (case-sensitive) functions.

For example, if No action is required both for "Delivered" and "Out for delivery" items, the following formula will work a treat:

=IF(ISNUMBER(SEARCH("deliv",C2)), "No", "Yes")
IF formula for text values with partial match

We've used the SEARCH function in the above formula since a case-insensitive match suits better for our data. If you want a case-sensitive match, simply replace SEARCH with FIND in this way:

=IF(ISNUMBER(FIND("text", where to search)), value_if_true, value_if_false)

Excel IF formula examples for dates

At first sight, it may seem that IF formulas for dates are identical to IF functions for numeric and text values that we've just discussed. Regrettably, it is not so.

Unlike many other Excel functions, IF cannot recognize dates and interprets them as mere text strings, which is why you cannot express your logical test simply as >"11/19/2014" or >11/19/2014. Neither of the above arguments is correct, alas.

Example 1. IF formulas for dates with DATEVALUE function

To make the Excel IF function to recognize a date in your logical test as a date, you have to wrap it in the DATEVALUE function, like this DATEVALUE("11/19/2014"). The complete IF formula may take the following shape:

=IF(C2<DATEVALUE("11/19/2014"), "Completed", "Coming soon")

As illustrated in the screenshot below, this IF formula evaluates the dates in column C and returns "Completed" if a game was played before Nov-11. Otherwise, the formula returns "Coming soon".
An example of the IF formula with the DATEVALUE function

Example 2. IF formulas with TODAY() function

In case you base your condition on the current date, you can use the TODAY() function in the logical_test argument of your IF formula. For example:

=IF(C2<DATEVALUE("11/19/2014"), "Completed", "Coming soon")

Naturally, the Excel IF function can understand more complex logical tests, as demonstrated in the next example.

Example 3. Advanced IF formulas for future and past dates

Suppose, you want to mark only the dates that occur in more than 30 days from now. In this case, you can express the logical_test argument as A2-TODAY()>30. The complete IF formula may be as follows:

=IF(A2-TODAY()>30, "Future date", "")

To point out past dates that occurred more than 30 days ago, you can use the following IF formula:

=IF(TODAY()-A2>30, "Past date", "")
Advanced IF formulas for future and past dates

If you want to have both indications in one column, you will need to use a nested IF function like this:

=IF(A2-TODAY()>30, "Future date", IF(TODAY()-A2>30, "Past date", ""))
A nested IF formula for dates

Excel IF examples for blank, non-blank cells

If you want to somehow mark your data based on a certain cell(s) being empty or not empty, you can either:

  • Use the Excel IF function in conjunction with ISBLANK, or
  • Use the logical expressions ="" (equal to blank) or <>"" (not equal to blank).

The table below explains the difference between these two approaches and provides formula example.

Logical test Description Formula Example
Blank cells ="" Evaluates to TRUE if a specified cell is visually empty, including cells with zero length strings.

Otherwise, evaluates to FALSE.

=IF(A1="", 0, 1)

Returns 0 if A1 is visually blank. Otherwise returns 1.

If A1 contains an empty string, the formula returns 0.

ISBLANK() Evaluates to TRUE is a specified cell contains absolutely nothing - no formula, no empty string returned by some other formula.

Otherwise, evaluates to FALSE.

=IF(ISBLANK(A1), 0, 1)

Returns the results identical to the above formula but treats cells with zero length strings as non-blank cells.

That is, if A1 contains an empty string, the formula returns 1.

Non-blank cells <>"" Evaluates to TRUE if a specified cell contains some data. Otherwise, evaluates to FALSE.

Cells with zero length strings are considered blank.

=IF(A1<>"", 1, 0)

Returns 1 if A1 is non-blank; otherwise returns 0.

If A1 contains an empty string, the formula returns 0.

ISBLANK()=FALSE Evaluates to TRUE if a specified cell is not empty. Otherwise, evaluates to FALSE.

Cells with zero length strings are considered non-blank.

=IF(ISBLANK(A1)=FALSE, 0, 1)

Works the same as the above formula, but returns 1 if A1 contains an empty string.

The following example demonstrates blank / non-blank logical test in action.

Suppose, you have a date in column C only if a corresponding game (column B) was played. Then, you can use either of the following IF formulas to mark completed games:

=IF($C2<>"", "Completed", "")

=IF(ISBLANK($C2)=FALSE, "Completed", "")

Since there are no zero-length strings in our table, both formulas will return identical results:
The IF formula for blank / non-blank cells

Hopefully, the above examples have helped you understand the general logic of the IF function. In practice, however, you would often want a single IF formula to check multiple conditions, and our next article will show you how to tackle this task. In addition, we will also explore nested IF functions, array IF formulas, IFEFFOR and IFNA functions and more. Please stay tuned and thank you for reading!

You may also be interested in:

2,787 Responses to "Using IF function in Excel: formulas for numbers, text, dates, blank cells"

  1. Max says:

    Hello,

    I have 2 columns..... say A & B

    Assume column A1 has some values already, and If I type any other words other than "Approved" in B1 or Column B1 is left empty, then Column A1 should stay in same old value, not even change to FALSE.....

    If and only if I type "Approved" in Column B1, then A1 should automatically change to "COMPLETED"

    These formula i need to populate throughout the column B

    Thanks....

  2. IRFAN says:

    HI IM TRIED FROMULA FOR IF TWO COLUMN VALUE IS SAME THEN I WANT PRINT VALUE TO ANOTHER COLUMN
    eg:-( if a=b value is same then c value print in e column)
    note** i want column value not cell like a2 value in some time is a4 value so can tell me the fromula please find the value of two column and then print value )

  3. Joseph says:

    Am working on a commission for my staff and I need an IF CONDITION OR VLOOK FORMULA to make it easier for me. This is how I have allotted the commission
    Sales Commission
    20,000.00 is 50.00
    25,0000 is 100.00
    30,000.00 is 150.00
    35,000.00 is 200.00
    40,000.00 is 250.00
    Please kindly help me out

  4. Caroline says:

    I am trying to add a column of money if the number opposite = the number 50

    =IF((J44:J55=50,sum(I44:I56),0)) - but this doesn't work

  5. Caroline says:

    I am trying to add a column of money if the number opposite = the number 50

    =IF((J44:J55=50,sum(I44:I56),0)) - but this doesn't work

    Tks in advance.

  6. madhav says:

    If values in A1:A10 are in numbers and values in B1:B10 are alphabets. some of the values are empty between B1:B10 like B3, B4, B7, B8. how to calculate values of A3, A4, A7, A8 with formula.

  7. Malar says:

    Sir/Madam,
    While awarding grades to particular mark range, I want a '-' where the marks are zero . I applied this formula but it doesn't seem to work.

    =IF(BX9>90,"A1",IF(BX9>80,"A2",IF(BX9>70,"B1",IF(BX9>60,"B2",IF(BX9>50,"C1",IF(BX9>40,"C2",IF(BX9>32,"D",IF(BX9<=32,"E",IF(BX9=0,"-",IF(I8="AB","AB"," "))))))))))

    Kindly guide me.
    Thanks in advance .
    Malar

    • Abrar says:

      Dear Malar as I have understood IF function it has three parts. Logic (greater, equal, less than etc), true or false parts. What you are trying to do is to put 10 IF functions in one cell. So I think it will not work. If you want to put "-" where marks are zero use this
      IF(BX9=0, "-", "")
      if BX 9 is zero it will return - value in cell other wise it will be empty.
      or use IF(BX9=0, "-", BX9) it will return original value if its not zero.
      As I understood you what you are trying to do is not possible with IF function. You have to find other function for this.

  8. Farakh Ali says:

    Hi,
    I'm Looking IF Formula For My Expense Sheet For Example In B1 I Write Anything Accept Leave Of Day Off So In C1 I Need Number 200 & When In C1 I Get 200 So In D1 Automatic I Get 250.

    Looking for Your Reply.

  9. Tony Mc Parland says:

    I am looking to join two cells together but separate the two values by a comma into a new cell.Can someone supply an =if statement that would help for this?

    • Nadia says:

      Hi there! I do this often to combine two cells with only a space separating and it's super easy. You simply add a new column and within that new column, you type in "=G2&","&H2" . The G2 & H2 simply represent the cells you want to combine. What you have in between the quotations is what is entered in between the combination, etc. Then do a drill down down the column for all others and you're all set!

  10. Johnny says:

    I have an interesting question and I am not sure if it is even possible.

    Can this be done? IF cell A1 = PR Then INCLUDE a 0 in Cell B1

    What I am trying to accomplish is adding a 0 to a zipcode. For example the state PR has zipcodes that begin with a 0 so if the cell has the text PR then INCLUDE a 0 to the cell that contains the zipcode.

    Is this possible?

  11. Agena says:

    Mine seems simple. I need

    Formula in H10
    If C10 contains "Payment" Then enter the sum that's in G10 into H10
    So if it's a payment I need the sum to move right one cell
    and yet I cant figure it out.

    Thanks

  12. ganga says:

    plz help me...
    1000000< marks 1, other every Lilian 1 marks and full marks 06

  13. AlyssaJ says:

    Trying to determine the lowest rating for a given security with two different ratings. If A1=Baa1 and B1=A3, the formula should return a value of Baa1 given the following hierarchy of ratings from highest to lowest (Aaa, Aa1, Aa2, Aa3, A1, A3, A3, Baa1, Baa2, Baa3, etc.). Thanks.

  14. Roman Pineda says:

    I am working on putting my budget on excel, and not sure how to have adding the amounts as they are enter to the correct category.
    =IF( EXACT(F6:F200,"Car Insurance"),0,SUM(G6:G200))
    what I am trying to accomplish here is that when i choose my category on F6 TO F200 from a drop down list, Car Insurance is an example, but i have electricity, cell phone, groceries, etc. After i choose my category next to it n G6 TO G200 I enter the expense amount for that day for that specific category. I want to create an statement that say if f6=ELECTRICITY, then use add G8 put it on another cell, b6, etc, if f6=cell phone, then add G6 to b8, etc.

  15. hhoyt says:

    Hi!

    I've been identifying non-integer numbers on large datasets using this formula (cell F2 for example):
    =IF(INT(F2)=F2, 0, 1)
    It works great...until you drag the function past 44,000 or so rows, and then it stops working.

    Any suggestions why or a workaround?

    Thanks in advance!

  16. Alfonso says:

    Hi,

    I am trying to use the if function but I am trying to use it for 3 different results
    if a number is lower than 18 if should say approved
    if it is between 18 and 24 it should say approaching
    and if the number is larger than 24 it should say finished

    I was able to use this formula like this
    =if(A2<18, "approved", "") that is what I am using but the problem is that the numbers contantly change and I need for it to include the 3 posibilities but this formula does nto allow me.

    Please help

  17. Marie says:

    Hi there,

    Can help me on this question.

    Cell B Cell C Cell D
    Point Eastings Northings Row 2
    1 567768 6376890
    2 567702 6376035
    3 567835 6377836
    4 567936 6376471
    5 568035 6376044
    6 566834 6377837
    7 567413 6378635
    8 566036 6378999
    9 568634 6377941
    10 566345 6376534

    1st Point
    2nd Point
    Diff East
    Diff North
    Distance

    I'm trying to use vlookup to calculate the distance between two points.
    I need to be able to choose any point I wish and type that into cell D14 (starting point). Then the same thing for the end
    point in cell D15. The difference between eastings and northings of both slected point will be display in cell D16 and D17.
    The distance (=SQRT(DiffEast^2 + DiffNorth^2) between two points will be displayed in D18.

  18. pranav says:

    Hi All,

    I am looking for assistance in developing one syntax where there could be three different conditions. Those conditions could be -

    1. If Date Is not crossed then Display date
    2. If Date Is crossed and status is not updated then "Planned Date Crossed, No status updated"
    3. If Date Is crossed and status is updated then Variance number between Plan Vs Actual Date.

    Excel have to verify certain details in the table before these three conditions could be verified. So one may have to use index match formula for the same.

    Also, the single cell number format should change automatically based on the cell value which could be date (First Criteria), numeric (Second Criteria) and text (Third Criteria).

    It looks pretty tough to me. Can anyone help on the same.

    Best

  19. Harold says:

    I didn't make my example ,clear. I have column "A" with these numbers 5 4 2 3 6 7 - In column "B" I have these numbers 30.92 , 31.29 , 31.11 ,31.17, 31.29, 31.07 If i select a number in column A or an adjacent number I want the minimum corresponding number in column "B" I need a formula for this. I tried this formula but all i get is zero.=MIN(IF(A4:A9>4,A4:A9<8,B4:B9)). i used control, shift, enter.I added some commas between some of the numbers to make it clearer.

  20. Mohammed says:

    Hi guyz,
    can you guys help me with a formula that can work with time.
    my situation is that i have to add 15 mins to people time who come after 8:04 am if they come before 8:04 am it should read 8:00.

  21. MAYANK MAHAJAN says:

    HI,
    CAN YOU SUGGEST ME FORMULA FOR THIS:-

    A B C D E
    INPUT OUTPUT BALANCE LIABILITY

    1 IGST 150000.00 175000.00 -25000.00
    2 CGST 57500.00 37500.00 20000.00
    3 SGST 57500.00 37500.00 20000.00

    1. PUT A FORMULA IN E1, IF D1 IS LESS THAN 0, THEN D1 CAN TAKE BALANCE FROM FIRST D2 THEN D3, IF NOT LESS THAN 0, THEN NOTHING.

    (LIKE IF D1 IS -25000, THEN D1 TAKE BALANCE OF 20000 FROM D2, AND 5000 FROM D3, THAN E1 BALANCE IS 0, E2 BALANCE IS 0, E3 BALANCE IS 15000.)

  22. Ana says:

    Hi All,

    I need to come with an IF formula for the following- it keeps telling it too many arguments

    IF 76=170 >141=200

  23. Julian Alessandov says:

    Oilgaztreyd LLC has been in business of production, marketing and exporting of all petroleum and petrochemical products for the past 15 years. We have been an established and popular company with an excellent track record for the best customer satisfaction. We have never compromised on the quality and the services provided to the customer. We believe in keeping the customers happy and providing them with products at a very competent price. We have an excellent staffs who will guide you with their best ideas by keeping in constant touch with your company and informing about the market trends. We are also interested to establish a mutual business relationship with buyers, facilitators and resellers all over the world with basic aim of supplying them with our products such as follow D2, jetFuel A1,JP54,Mazut M100,D6,Base Oil and Bitumen.

    Also we work with other foreign partnered refineries in allocation production.

    Regards,
    Julian Alessandov
    Email:oilandgaztreyd@mail.ru
    Email:oilandgaztrey@yandex.ru

  24. Niesah says:

    For one of our lab tests, we take 2 weights. The second can't be more than 0.4 away from the first. If it is, then we have to do a third weight. I need the "residue" cell to calculate depending on that. If the second weight is within 0.4, I need it to use that. If not, there will be a third weight entered, and I need the "residue" cell to calculate based on that one. Can anyone help?!?

  25. Jon says:

    So I am trying to make a call schedule for my work and am having trouble creating a formula that will help me. What I am looking to do is have the Initial Call date (A) and a column for the call back date (B). I want excel to fill in the call back date for me (B) for a certain length of time per my customers buying level.
    Ex: If customer is "gold level" (C) and the initial call date (A) is 1/1/2017 then call back in 30 days or 1 month (2/1/2017) (B) or,
    If customer is "silver level" (C) and the initial call date (A) is 1/1/2017 then call back in 60 days or 2 months (3/1/2017) (B).
    Can this be done? Thanks for the help!

  26. John C says:

    Hi,

    I was looking at doing a formula like the below;

    =IF(ISNUMBER(SEARCH(”P”,D19,3)),(VLOOKUP(D19,'Rates Summary '!A$2:Q$1573,2,0)),D19)

    Basically, I have a code "QAPLI0" in cell D19. What i want to do is convert this to a QAR code which is what my Vlookup is for. Only problem is that when i already have a QAR code in the cell D19 it still brings me back a QAP instead of leaving it was whats already in the cell D19 which is what i though i had down as the "value if false" part of the IF statement.

    Am i making sense? I tried to use a FIND instead of SEARCH but got the same result. Am i missing something here?

    Any help would be great.

    Thanks
    Jon

    • Hi, John,

      Please note that you have smart quotes instead of double ones in SEARCH(”P”
      If this is the way the formula is written in Excel, ISNUMBER will always return false.
      Also, ’Rates Summary ‘ has space at the end.

      If this doesn't solve your problem, please send us your workbook to take a look at to support@ablebits.com. Please don't worry if you have confidential information there, we never disclose the data we get from our customers and delete it as soon as the problem is resolved.

  27. Paddy says:

    Hi, I have a problem while using IF function.

    IAm trying to use if function Column B & C with a formula that if column B contains CLOSED than C should be CURRENT date and the formula is " =IF(B2="CLOSED",TODAY(),"") ".

    It is working correctly, however, while opening the excel sheet in the next day, it is reflecting the current day and it is not reflecting the date which I actually enter CLOSED in column B on the particular date.

    Can someone please help me to fix, what exactly am I doing wrong here?

    Thanks,
    Paddy

  28. Emcee says:

    Hi,
    I have a workbook consisting of two worksheets.
    On worksheet one I record who has taken what showing quantity and sizes.
    On worksheet two I am keeping a usage report of those same items handed to numerous contractors(stock, ppe etc) showing size and quantity usage.
    I want a formula put on w/s 2 cell Q4 that if on worksheet 1 in block C4 the value is "S" then the value of q4 must be the same as the value in D4 on w/s 1.
    Can you help please.
    Thanks
    Emcee

  29. David says:

    I am trying to produce a number in a cell.

    The number must come from column F when then column C and column N match a specific text.

    The formula I have tried only give FALSE results.

    =IF(AND('Sheet1'C:C="XYZ", 'Sheet1'!N:N="ABC"), 'Sheet1'!F:F, "N/A")

    Any help would be appreciated.

    • Hello, David,

      I'm afraid this formula won't work like this.

      If you need to return only one number from each F cell, you need to use a separate formula for each separate cell, like:
      =IF(AND(‘Sheet1’C2=”XYZ”, ‘Sheet1’!N2=”ABC”), ‘Sheet1’!F2, “N/A”)
      (you can place the formula into one cell, and copy it down the column)

      Ii you need to perform some mathematical operation with the found values, you need to enclose the whole IF formula into COUNT, or SUM, or AVERAGE, or some other function depending on the operation you need. In this case it is an array formula. It is entered by pressing Ctrl+Shift+Enter on your keyboard instead of just Enter.

      Hope this helps!

  30. Rakesh says:

    what would be the formula

    if the sum total in C10 is less than or equal to 300 the cell should show 300 but if C10 is greater than 300 then it should pick the C10 value.

    can you help me in this

  31. Anat says:

    Hi Sveltalana ,
    I have 2 cells with dates(A2, B2) , i would like B2 to highlight if it is larger than 180 days / 6 months than cell A2

  32. Surya says:

    Hi

    I have value in a cell(A1) like "01-USA" (This is fixed Cell Value)
    Another Cell(A2) value is changing as per country selection but sometimes value comes same as in fixed cell. Please note both cells have text value only.
    so I want following results

    If A2 value is same as A1 then result like 10-5 =5
    If A2(02--Canada) value is different from A1(01-USA) then result must be Blank

    Thanks in advance for your help.

  33. YossiD says:

    I have used a simple IF statement to identify Pass/Fail conditions.

    IF(I4>1, "FAIL", "PASS"). As long as I4 contains actual results, this works fine.

    But sometimes there is text in I4 (see note, etc.). Since the text is not >1, the result should be PASS, but I'm getting FAIL.

    So I turned it around: IF(I4<=1, "PASS", "FAIL"), but the results are the same, FAIL when there's text in I4.

    Can you explain this?

    (Still) using Excel 2003 (I hate the ribbons).

    Thanks

  34. Glenn says:

    Hello,
    I'm using excel 2010.
    In cell D2 is a date. F.e. 07/08/2017
    In cell G2 is a value F.e. 38
    I would like to use a formula in cell I2, which will give me the value from cell G2, if the date in cell D2 is greater or equal than 28/08/2017.. I am currently using the formula: IF(D228/08/2017;G2;IF(D2<28/08/2017;""))
    So normally in my example, the outcome should be "" because the date in cell D2 is smaller than 28/08/2017 but it doesn't...

  35. Jignesh Vyas says:

    i have to calculate overtime data

    OE Names Orders Processed Target Extra Orders
    Amit Singh 38 40 -2

    Now i only want to pay overtime if my team members have met the target and they can get the overtime paid for whatever extra orders they have processed else the variance cell should indicate 0 for not having earned any overtime.

  36. Willard says:

    I have the operation like this:
    =if(A1=8,50,"")

    What will i do if i will add the operation like A1 =0,0

    How do i include that on my operation. Thanks thanks

  37. pp says:

    I have a cell (say A1) contain values like this format:0.453, 0.583, 0.383. I want to get each number from cell and compare if they are > 1. And I write this for 1st number(0.453): =IF(LEFT(A1,5)>1, 1, 0)
    It return 1 which is not correct. I check "LEFT(A1,5)>1" can return 0.453. Thanks for your advice.

  38. ASHUTOSH JOSHI says:

    Hi friends,

    kindly guide me for solve the problem i.e. "i need answer of a employee attendance it is in excel sheet that have P for present and .75 is leave of 1/4 and .5 is half day how can i solve it ?

    Lokendra Sahu P L P P P P P P L P 0.75 P 0.50 P P L P P P P P P L P P P P P P L P 24 7.00 0 31

  39. ASHUTOSH JOSHI says:

    Thanks again

  40. ILKIN says:

    Hello.
    I want to use IF function, but dont it.
    For exmp.
    IF B4=1,B4=2,B4=3,B4=4 "BAD"
    IF B4=5,B4=6,B4=7,B4=8 "GOOD"
    IF B4=9,B4=10,B4=11,B4=12 "OK"
    IF B4=13 "SUPER"

  41. Tom Spies says:

    Hello,
    I am trying to compare a date in C2 and if equal to a range of dates in another row =IF(C2=D5:D10,1,0)

  42. nOOrylw says:

    Hi,

    I was hoping to get some help with my formula below:

    My cell E32 is interchangeable, could be 50, 45, 32, 0, e.t.c. I want the returned value to be in two (2) decimal place if condition is met in the formula. instead of just displaying 1, 2, 3, 4,5 in my formula it should give me exact value in 1 or 2 decimal places. i tried to add .0 to the formula but eachtime it keeps disappearing.

    =IF(AND(E32>0,E322.2,E324.4,E326.6,E328.8,E32<=11),5,"Out of Range")))))

    Thanks

  43. pathy says:

    can I get a formula to generate a pattern like this
    1
    1
    2
    2
    3
    3
    4
    4
    5
    5
    and so on.......

  44. shi says:

    hi

    i want to know how to use Round function to the below formula

    =round(IF(G2<60,'Export Worksheet'!AD2*5%/365*G2,IF(G2<120,'Export Worksheet'!AD2*10%/365*G2,IF(G2<180,'Export Worksheet'!AD2*15%/365*G2))))

  45. Jacob Tibenkana says:

    can someone help, looking for formula to yes or no if number in cell C1 is greater than or equal to 3 of number in cell B1.

  46. JB says:

    Hi,

    I am trying to pull a number based on the input.

    IF(B24510030045, then result should be as C27 & B2 valus is >100<299 then C27...

    Can anyone help me to solve the issue for me..Thanks in advacne

    • JB says:

      Hi,

      I am trying to pull a number based on the input.

      =IF(B245100300500,C6)))) IF the input value is B2 = 5 then result should be as C2 & B2 value is >100<299 then C4...

      Can anyone help me to solve the issue for me..Thanks in advance

  47. Saurabh Singh says:

    Hello,
    I'm trying to use if formula based upon Text value in a cell, but wanna use another 2 different if formula (for aging bucket based upon value of different column) based upon text matches or not.
    but unable to run it, anyone please help me

    =IF(OR(L2="GDC","=IF(J2<=7,"0-7 days",IF(J2<=30,"8-30 days",IF(J2<=45,"31-45 days",IF(J2<=60,"46-60 days",IF(J2<=90,"61-90 days",IF(J2<=180,"91-180 days",IF(J2<=365,"181-365 days","365+ days")))))))","=IF(J2<=2,"0-2 days",IF(J2<=5,"3-5 days",IF(J2 15 ")))"))

  48. IRFAN says:

    =IF(C12<100,C12<200,C12<500,"C12*1,C12*1.5,C12*2")

  49. GEORGE says:

    dear sir/madam,
    i want to use IF function to come up with a formulae that will be giving me selling price basing on the below markup(in percentage);

    1)100≤Price of item ≥0 = 172.5%
    2)500 ≤ Price of item≥101 =137.5%
    3)5,000≤price of item≥501=77.5%
    4)20,000≤price of item≥5,001=57.5%
    5)40,000≤price of item≥20,001=77.5%
    6)100,000≤price of item≥40,001=37.5%
    7)Price of an item ≥100,001 =17.5%
    i want an excel sheet where i will be inserting the invoiced amount and the column with the formulae give me the selling price.

    thanks in advance.

    regards
    george

  50. Sumit says:

    Dear All,

    scenario as below.
    Price
    A1 B1
    1 YES
    2
    3
    4
    5
    i want to use formula wherein B1 Column populate automatically as "YES" to which the lower price is.

    Please help

  51. Josh says:

    Was hoping you could help me? Here is my current formula:
    =IF(ISNUMBER(E15),VLOOKUP(E15,ReferenceTables!$B$13:$C$26,2)-F15,"0")

    Now I'd like to add "IF H15, I15 or J15 show any text, reduce this number by one"

    Thanks!

    • Hello, Josh,

      for us to be able to assist you better, please describe in more detail the last part of your condition with the text in H15, I15 and J15.

      If you still need help with this formula, it would be better if you could send us a small sample workbook with the data and the result you expect to get to support@ablebits.com. I kindly ask you to shorten your table to 10-20 rows.
      Don't forget to include the link to this comment.

      Our tech specialist will take a look at your task and try to help.

  52. Warren says:

    I was wondering if anyone could help me out with an if statement.

    I have a figure in cell B5 I want to run an IF/OR statement on it to do the following:

    If B5 <5 then use the value in X5, OR if B5 = 5 AND 10, then use the value in X7

    Any help would be appreciated.

  53. Lori says:

    I need help with a formula.
    I have a list of individual names some duplicate names. The duplicate names have test scores which I need to see if the score increased or decreased by when they took the test which is by date.
    How can i make a formula to look for multiple last names then look by date and score to get a result of increased +20 or decreased-20
    Example:

    Smith 200 9/25/2017
    Smith 175 9/1/2017

    Jones 150 9/24/2017
    Jones 180 9/1/2017

    I would appreciate if anyone knows how I can do this.

  54. Zsofia says:

    Hello, hope you can help!

    I have a column(A) with a drop-down menu with 7 different options ('Meeting', 'Private Party. 'Weddings', etc)That run on a calendar year.

    I have another tab where I have each option in a column (B), and next to it (C), I would like to have the total numbers of 'meeting', 'Party', 'Weddings' (from column A) within that Year (So a total SUM)

    How can I use the Sun formulas for a Word variable?

    does this make sense?

  55. Vlad says:

    Hi Ablebits.com Team

    I am looking FOR help with formula for the following condition:

    When A1 B1 AND C1=D1 AND A10 AND B10, then assign E1 value "5065"
    When A1 B1 AND C1=D1 AND A1=0 AND B10, then assign E1 value "5065"
    When A1 B1 AND C1=D1 AND A10 AND B1=0, then assign E1 value "5066"
    When ABS A1 = ABS B1 AND C1D1, then assign E1 value "5067"

    THANKS.

  56. Daniel says:

    Hi Ablebits.com Team,

    I am looking for help what kind of formula to resolve this condition.

    When A1= coal and B1= coal, then assign as coal
    however, when A1= coal and B1= 0, then assign as 0

  57. Leo says:

    Hi,

    here's my formula right now:
    =FLOOR(MAX(C19,G19), 0.125)+$K$8

    what I want to do is that, i want to add an IF that if C19 and G19 are the same value, the formula will automatically deducts 5 from G19.

    any help will be much appreciated.

    Thank you

  58. varun says:

    Hi, Please help me in this senario.

    If there is a data (String) in "A2" need to compare with a range of cells say F1:F20. How can we compare using IF condition, or pls suggest me other possibilities.

    Regards,
    Varun.

  59. Gofa says:

    Hello
    I need help to output the following:
    if given a list of id numbers and the 5th number represents sex i.e 1=male 2=female
    which formula can I use to find the sex
    eg given the following IDS:
    001329876
    123415672

  60. Felicia says:

    Hi, please help in my formula. I only get the first part right. If cell AB=1/2/3/4, returns 'Closed', else 'Open'. And if cell AB=#value!, returns Open.
    This is the formula I am using right now.
    =IF(OR(AND(AB3=1),AND(AB3=2),AND(AB3=3),AND(AB3=4)),"Closed","Open")
    Thanks a lot for ur help.

  61. Terry AUSTIN says:

    I am attempting to devise a formula that will assist me to calculate the payroll for my employees. It needs to address number of hours worked & then various rates of pay for those hours.

    So far I have come up with the following:

    =IF(AJ6>=3,(AJ6-3)*AN6+(3*AK6))+IF(AJ6>=3,(AH6-AJ6)*AI6)+IF(AJ6=3 - in the first instance I need a 0 recorded if cell AJ6> cell AH6
    - should that not be the case then I need the following calculation to take place (cell AH6 - cellAJ6)*cell AI6 (where cells AH & AJ are hours worked & cell AI is a rate of pay.

    My many attempts have been close but do not seem to recognise the IF/OR component - I need this because if it calculates a negative number as it can in the first instance it decreases the pay of my employees.

    Can someone out there help me?

  62. John says:

    I want to have a formula in which if the issue date in G6 is the 1st 7 days of the month then the expiry date in H6 will be the end of that month, however if the issue date in G6 is 8th-end of month then the expiry date in H6 will be the end of the next month.

  63. Neil says:

    I would like to show a value of yes or no depending if a vehicle reg is displayed in a colum of cells. i have tried =IF(N7="WA60 BHU","YES","NO") but this only works if wa60 appears in cell n7 i would like it to say yes if it appeared in cell n7 to n20 or no if it is not displayed.

    Thanks

  64. levi kamanga says:

    =if ( 'Visual Assessment Summary'!Y7='Visual Assessment Summary'! 8, if ('Visual Assessment Summary'!Y7="M" ,6, if( 'Visual Assessment Summary'!Y7="L",5,0))

  65. YASSER says:

    hi , iam from egypt please i need to explain how to make comparison between old list numbers with new list ( ex. 1254as = 1254as
    5478ad # 5478ac
    4568ab = 4568ab )
    i know we can used if function but how by details ?
    thanks for your support

  66. Annonymous says:

    I am inputting the follwoing formula into my spreadsheet:
    =+IF((BG2=1)*AND(BH2=1)*AND(BF2<40000),1,0)

    This is the data it is pulling:
    BF BG BH
    0.00 1 1

    My result is still showing as "0" when it should be showing "1". Can anyone explain what I am missing??

  67. Kim says:

    is there a formula for multiple logical test
    example. I wanted to place a certain word into a certain cell if it contains an specific text. thank you

  68. JTC says:

    Hello,
    I have a spreadsheet that tracks investigations at different facilities. I am trying to find a formula that can give me the most up to date status of the facility. Here is some background: Every time the site is inspected, a particular operating status is evaluated and "T" or "F" is entered in the cell. Since the status can change from time to time, I would like to capture the most up to date status. The spreadsheet is designed with one row per site so my range will have to be across the row. i.e. I am looking at the last time a T or F was entered in that row. I hope this makes sense.

    Thanks in advance for your help!

  69. Did you get the answer because I need that formula as well? says:

    What would be the equation for 1000 ≥ certain cell block ≥ 501 =30%? For instance if certain cell block equaled 5000 the answer would be 150.

  70. Ali says:

    Help! I am working on an excel and I want to know the function that if the value of D column is yes then the true value lie between 2002/9/13 to 2005/12/29 and if its false then it shows "N/A" please tell me the function need help? :)

  71. SANTHOSH says:

    Dear friends,

    i need a help for applying if condition in excel, in a column few different different text is there and few cell having MRP, if it is mrp cells have to multiply with qtys (599*12)if it is text in a cell that cells consider 300 rs * qty hot to apply if condition, please find the below the details and help me

    MRP VARIANCE FORMULA VALUE DIFF
    799 1 =IF(I6="NA",J6*300,IF(I6="",J6*300,J6*I6)) 799
    -1 =IF(I7="NA",J7*300,IF(I7="",J7*300,J7*I7)) -300
    NA 4 =IF(I8="NA",J8*300,IF(I8="",J8*300,J8*I8)) 1200
    tata 3 =IF(I9="NA",J9*300,IF(I9="",J9*300,J9*I9)) #VALUE!
    immma 7 =IF(I10="NA",J10*300,IF(I10="",J10*300,J10*I10)) #VALUE!

  72. Ramo Travis says:

    How do I get cells in Excel to equal set amounts? For example if I was holding a competition to see how many ribbons kids could find? The ribbons would be different colors, and depending on the color the ribbon would worth different points?

    Blue=100
    Red=75
    Yellow=25
    Green=15

    Thank you in advance!

  73. ALAGAPPAN S says:

    In Cell A2:A20 I have numeric (200.00) data. some cells are blank.
    1)how to convert blank cells into 0.00 Format cells converts numbers into 0.00 format if number is present.otherwise it is blank
    2)How to use If Isblank() formula for this conversion of blanks to 0 or if number is present, retain the same number

  74. SooSee says:

    In cell A cell B
    apple 1x
    grape 1x
    strawberry 1x
    grape 2x
    melon 1x
    grape 3x
    what function do i need to complete my cell B automatically
    tq....

    • Hello,

      I'm afraid there's no easy way to solve your task with a formula. Using a VBA macro would be the best option here.

      However, since we do not cover the programming area (VBA-related questions), I can advice you to try and look for the solution in VBA sections on mrexcel.com or excelforum.com.

      Sorry I can't assist you better.

  75. arvin says:

    Hello, I am trying to get a cell AB3 to show "complete" and if not to show "pending" when Cells on the spreadsheet H3,N3,T3, and Z3 are all showing "complete". I do not have the slightest idea how to write the "IF" formula.

    Any suggestions are appreciated greatly!

    • Hemanth says:

      If(and(H3="COMPLETE",N3="COMPLETE=,T3="COMPLETE",Z3="COMPLETE"),"complete","pending")

      I done by mobile but its correct check

  76. princess says:

    Hi. I have a question on the IF logic: state the status in a column as COSTLY if total expense is above $20,000, or FAIR if total expense is less than $20,000 but greater than $10,000, or MAINTAIN if total expenses is below $10,000

  77. wANDA says:

    I need to have a formula for the following; exp, column D, if b1=1, then enter vc; if b1=2, then enter vce if b1=3, then enter pp, and so on up to #5
    thank you so very much for helping me

  78. geoofrey Saya says:

    I have an excel document with three columns.

    Example; I have the Name of staff, Amount contributed (deposit), amount applied from loan. I want to insert another collumn to analyze how many have qualified to receive the loan. I the new collumn, I want to introduce clients who have paid the required deposit( qualification amount and bring in the new collunm the amount of loan applied. Eg If qualification amount is $500,and the clients has applied a loan of $100000, i want the $100000 to appear in the new collumn by use of the formullae.

  79. Mara says:

    I am having trouble finding a formula for defining the payment deadline for invoices.
    If the invoice is dated before the 15 of a month it should be paid by the 15th of the following month, otherwise it should be paid before the 30th of the following month.
    I've tried combining IF with DATE but it returns the formula as text...

  80. ramakrishnan says:

    EX:1
    A
    -10
    0
    IF(A1=0," ",)

    help to us..

  81. Deepak says:

    In excel, my cell contains either x or y text. If text is x, then I need to put multiplication of three cells and if y, then need to put multiplication of other three different cells. how to put formula in the cell?

  82. Dayi says:

    Hi want to ask if a have an array of data, each of my samples have a row of value (few column of descriptive value). and I want to use IFBLANK() to check the each of the row to give it a "complete"(if all are filled) or "incomplete" (if it got any empty cells in the row) data.

    How do i do it? IFBLANK(C2:X2) for example, it just gave "false" to the row but it still has an empty cell.

  83. MATT says:

    Hey! I am trying to write an IF FUNCTION that will take the value of a cell in a table in the cell before equals a specific word. (I hope this makes sense)

    Example: If C4 has the word "ESSENTIAL" within the cell, that I want D4 to be copied into another cell.

    The plan is to track spending, on specific items, based on how they are catagorized. Then put all the ones that are catagorized into a new table with a sum for that catagory.

    Hope this makes sense

Post a comment



Unfortunately, due to the volume of comments received we cannot guarantee that we will be able to give you a timely response. When posting a question, please be very clear and concise. We thank you for understanding!
Excel add-ins and Outlook tools - Ablebits.com
Ultimate Suite for Excel Professionals
 
 
60+ professional tools for Excel 2016-2007 to do your daily work
Incredible product, even better tech support…AbleBits totally delivers!
Deborah Bryant
Anyone who works with Excel is sure to find their work made easier
Jackie Lee
The best spent money on software I've ever spent!
Patrick Raugh
Ablebits is a fantastic product - easy to use and so efficient.
Debra Celmer
Excel is at its best now
Annie C.
I don't know how to thank you enough for your Excel add-ins
Jennifer Morningstar
Anybody who experiences it, is bound to love it!
Kumar Nepa
AbleBits suite has really helped me when I was in a crunch!
Nelda Fink
I have enjoyed every bit of it and time am using it
Christian Onyekachi Nwosu
It's the best $100 we've ever spent!
Mike Cavanagh
I love the program, and I can't imagine using Excel without it!
Robert Madsen
One word… WOW!
Dave Brown
Love the products!
David Johnston
It is like having an expert at my shoulder helping me…
Linda Shakespeare
Your software really helps make my job easier
Jeannie C.
Thanks for a terrific product that is worth every single cent!
Dianne Young
I love your product
Brad Gibson
Awesome!!!
Sheila Blanchard