# Using IF function in Excel: formula examples for numbers, text, dates, blank cells

IF is one of the most popular and useful functions in Excel. 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.

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 users.

## Excel IF function - syntax and usage

The IF function is one of 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 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 (required) - a value or logical expression that can be either TRUE or FALSE. 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 (optional) - the value to return when the logical test evaluates to TRUE, i.e. if the condition is met.

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 (optional) - the value to be returned if the logical test evaluates to FALSE, i.e. if the condition is not met.

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")`

#### 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 (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")`

In case you don't want your Excel IF statement 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 functions.

The following screenshot demonstrates the above approaches in action, and the second one seems to be more sensible:

2. If value_if_false is omitted

If you don't care what happens when the specified condition is not met, you can omit the 3rd parameter in your 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")`

Putting a comma after the value_if_true argument forces your IF formula to return 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", "")`

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

For 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)`

Note. For your IF statement to return TRUE and FALSE as the logical values (Boolean values) that other 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 "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. IF formula to perform a math operation and return a result

Instead of returning certain values, you can get 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 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 IF function's syntax, let's look at some formula examples and learn how to use it in real-life scenarios.

### Excel IF statement 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:

### Excel IF examples for text values

Generally, you write an IF statement with text 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 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 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.

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.

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. Excel IF with wildcard (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 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")`

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 statements 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 IF function 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".

#### 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", "")`

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", ""))`

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

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!

### 4,376 comments to "Using IF function in Excel: formula examples for numbers, text, dates, blank cells"

1. Peter says:

My formula is used to do education tracking for work:

{=MAX(IF('Raw Data'!\$A\$2:\$A\$19997=\$C\$31,(IF('Raw Data'!\$I\$2:\$I\$19997='Course Names'!E47,'Raw Data'!\$L\$2:\$L\$19997))))}

It worked great when there was only one course per requirement. Now there are 4+ course names per requirement. I was wondering if it is possible to modify the 'Course Names'!E47 part of the formula to have multiple courses to draw the most current date from.

I tried 'Course Names'!E47:E53 But it keeps giving me a #N/A error now. Unless I drop it down to one course. I suppose I could list every single course but that could get quite large and I try to keep the readout to one page for ease of use for the manager.

I am using Excel 2016.

ANy help would be greatly appreciated.

• Hi!

Instead of \$I\$2:\$I\$19997=E47 use OR(\$I\$2:\$I\$19997=E47,\$I\$2:\$I\$19997=E48,\$I\$2:\$I\$19997=E49,\$I\$2:\$I\$19997=E50 ......)
If this is not what you wanted, please describe the problem in more detail.

• Peter says:

Hi Alexander,
I was able to modify my formula using part of the article listed. Thank you for your help the formula works great now with multiple search parameters.
Peter

2. olejohn says:

Hi,
i need to highlight the entire row if A2 has text value containing an even number at the end of it (basically it's alphanumeric). eg.. if A2 has "hrr-102" where 2 at the end is even, then it should highlight the entire row. thanks experts for your ansers.

3. Salihin Jumahat says:

hi,

my data: =MAX((IF(H15=H15,I15,"")),(IF(K15=K15,L15,"")),(IF(N15=N15,O15,"")),(IF(Q15=Q15,R15,"")))
they show zero*
i want the max number and show the alphabet rather than the number.

DATA:
22-001(H15) A(I15)
22-008(K15) UR(L15)
22-010(N15) NA(O15)
22-032(Q15) AC(R15)

• Hi!
You cannot search for the maximum value, since 22-001 is text, not a number.
If your cells will contain numbers, then you can use the INDEX + MATCH functions to lookup the value:

=INDEX(I14:R14,MATCH(MAX(H15:Q15),H15:Q15,0))

• Salihin Jumahat says:

if my cell contain alphabet then how?

• Hi!
Extract the number you need from the text in a separate column. Use this article's recommendations: Extract number from text string.

4. OGAL ISAAC says:

Hello check this formula out and guide with the right one
=IF(A3="printing",=500,IF(A3="photocopying",=200,IF(A3="scanning",=1000)))

• Hi!
Pay attention to the first paragraph of the article above. Take a close look at the syntax of the IF function.

=IF(A3="printing",500,IF(A3="photocopying",200,IF(A3="scanning",1000,"")))

5. Salihin Jumahat says:

excel if h7<j7<K7 it will show h7 or j7 or k7 value

6. Salihin Jumahat says:

hi
how do i create a command that

it will update my latest

example
latest; 22-030
day1 22-001
day2 22-015
day3 22-023
day4 22-030
day5
day6

• Hi!
I don't see any pattern in your data.

7. Bhavya says:

Hi

I want help in writing an advanced function which gives the output in week number when the existing inventory specified in the data will run out. The column header specify product title, existing inventory quantity, Sales projections from WK 1 to WK 52. The rows have the product name, and the corresponding values to the headers. Please refer to the below data for reference:

Product A, Qty 52, WK 1 - 10 units, WK 2 - 10 units, WK 3 - 10 units, WK 4 - 12 units, WK 5 - 10 units
Product B, Qty 65, WK 1 - 5 units, WK 2 - 10 units, WK 3 - 10 units, WK 4 - 10 units, WK 5 - 10 units, WK 6 - 10 units, WK 7 - 10 units

I want a the output as a column in which it specifies the WK num in which the existing qty is running out.
The answer should be like WK 5 for Product A and WK 7 for product B.

Is this possible?

Regards
Bhavya Naidu

• Hi!
I think that with the help of one formula your problem cannot be solved. You can calculate the running total for sales projections and compare it with the existing inventory quantity.

8. Nuwan says:

Hi There,
I need your help to fix this formula. if a colleague works more than 365 days but less than 1800 days that the number of days should multiply by 0.02. but if the colleague works more than 1095 days and less than 1800 days, then that number of days should multiply by 0.04. Above 1825 days then must multiply by 0.06
if he works more than 2190 days then should multiply by 0.08.

Thanks
Nuwan

9. Jerome says:

Hello!

Im trying to place multiple functions in single formula, however, I have a roadblock which hopefully we can clear,

My current formula is:
=IF(I2=G2,"Completed Same Day Plotted",IF(I2G2,"Didn't Complete On Time")))

Legend:
I2 - Date Completed (this data is extracted and vlooked up from another report)
G2 - Plotted Date

The problem Im encountering is, in the source file of the Date Completed, if it appears blank, it will automatically place 0/01/1900 which will trigger the Completed Before Plotted Date.

I'm trying to add a formula that would generate a result stating if date is 0/01/1900, it means the person is currently finishing the course or it can be reflecting as "In Progress".

How do I do that?

• Hello!
Date 0/01/1900 is 0 in date format. Therefore, add another condition to your formula to check if the value is 0.

=IF(I2=G2,”Completed Same Day Plotted”,IF(I2 > G2,”Didn’t Complete On Time”,IF(I2=0,”In Progress”))))

10. samuel poracan says:

What is the formula if I want a cell to input the following:
If cell is
001 input COGON
002 input DICAYAS
003 input DIWAN
004 input GALAS
005 input GULAYON
006 input LUGDUNGAN
007 input MINAOG
008 input OLINGAN
009 input ESTACA_(POB.)
010 input BIASONG_(POB.)
011 input BARRA_(POB.)
012 input CENTRAL_(POB.)
013 input MIPUTAK_(POB.)
014 input PUNTA
015 input SAN_JOSE
016 input SANGKOL
017 input SANTA_FILOMENA
018 input SICAYAB
019 input SINAMAN
020 input TURNO
021 input SANTA_ISABEL

11. Lorna Allen says:

Hi I am trying to do the following with dates and it seems the if(or) does not recognise the dates as a value

=If(or(j4="",N2<J4),G4,K4)

J4=date
N2=date
G4=£
K4=£

I am basically trying to say if J4 date is blank then use selling price G4, If month date N2 is less than the date J4 then use new selling price K4

any help would be appreciated

Lorna

• Hello!

=IF(J4="",G4,IF(N2 < J4,K4,""))

12. David Boyanich says:

This was awesome. I wanted to track the status of an inventory of items that move from one status to another status as they are delivered, used, and readied for removal. This will assist in visualizing the lifespan of an object by using nested if statements and using the cell value as the final "if not true" statement to keep the value present when if has a calculation change but only on the date that the change takes place. This is interesting. my formula does require the file to be opened each day, so that the date change will trigger the status calculation in the field. I am using conditional statements to color code the cells based on the values 1,2 or 3 which is assigned to the cell of the date on that line of the object based on its status which is chosen off criteria as I alter the cell information of the objects as they change status by entering the date of the change of that status, and using a null cell to keep unused rows from calculation.

Works great.

13. RK says:

A1 is “Full”, B1 is “Not Full”, C1 returns “Full”
A2 is “Full”, B2 is “Full”, C2 returns “Full”
A3 is “Half Full”, B3 is “Full”, C3 returns “Half Full”
A4 is “Not Full”, B4 is “Half Full”, C4 returns “Half Full”
A5 is “Not Full”, B5 is “Not Full”, C5 returns “Not Full”

As long as there is Half Full in either col A or col B, col C will return “Half full”

Can anyone help? I can’t find a formula to return 3 end results (full/not full/half full)

• Hello!
If there are too many conditions, then it is better to use the CHOOSE function instead of the IF function:

=CHOOSE(MATCH(N1,{"Not Full","Half Full","Full"},0) + MATCH(O1,{"Not Full","Half Full","Full"},0)*2, "Not Full","Full","","Half Full","","","Half Full","Full")

14. Debashis kar says:

I want to link a cell instead of text in value -if -true in nested if formulas. what to do

15. iRFAN says:

Hi i have 4 letter words. In which any word starting with letter DL should show as LCC otherwise GCC . i am getting the result with following formula

=IF(ISNUMBER(SEARCH("DL",B55)), "LCC", "GCC")

but problem is that, if DL is third or fourth letter even though i m getting the result as LCC which i dont want

Kindly help

• Hi!
Use the IFERROR function to handle "DL" search errors:

=IF(IFERROR(SEARCH("DL",A1),5)=1, "LCC", "GCC")

• iRFAN says:

Thank you Alexander for your promp reply and yes you solution has worked perfect

Regards/Irfan

16. Julian Flanagan says:

Hi,
my very simple formula, continues not to work;
for example

Help :)
Thanks Julian

17. kim hubbard says:

Hello, can someone help me please? I need to do an IF function but where true i need it to equal another cells contents, is this possible? every time i do it like this =IF(E2>0,"A2","") it keeps pulling back the words A2 and not the actual contents of A2... I may be being dumb...

• MissusT says:

try: =IF(E2>0,A2," ")

you don't need quotes when referencing a cell

18. CARLA POPE-LAWRENCE says:

I want to use an IF function to calculate taxes of 1% on an income more than 6250 per month.

Hi! I Have the next if statement:
=IF(C4=F4, "[] ", (IF(C4=F5, "[] ", (IF(C4=F6, "[]", "Error, please choose a correct platform")))))

Between "[]" I want to put a cell value like this [&D5] but excel is printing the string "[&D5]".
How can I insert the value of a cell inside a string of an if statement?

Thank your for the post, was so usefully!

• Hello!

=IF(C4=F4,"["&D5&"] ",(IF(C4=F5,"["&D5&"] ",(IF(C4=F6,"["&D5&"] ","Error, please choose a correct platform")))))

20. Rahul Sharma says:

Hello. I have a query. I want to use a simple IF function and print a true or false result.

=IF(E22>=J22,"Person A won INR ","Person B won INR ")

In the above formula, in the statement "Person A won INR " after INR I want to print the value of the result (E22-J22)

For example, if E22 is 200 and J22 is 100, It should print "Person A won INR 100"

• Hi!
To concatenate text and a number, use the & operator or CONCATENATE function.

=IF(E22>=J22,”Person A won INR “&J22,”Person B won INR “)

• Rahul Sharma says:

I am using the below formula but still it is complaining of invalid name error.

=IF(E22>=J22,”Person A WON INR“& " " &G38,”Person B WON INR“& " " &G39)

G38 has value for E22-J22
G39 has value for J22-E22.

• Hi!
Unfortunately, I could not replicate your problem and got an invalid name error.

• Rahul Sharma says:

Please ignore my last reply. It is resolved now. Thanks a lot for the quick response Alexander :)

21. Rochelle says:

Need a formula for
if C3 = number then D# = a name

I can change or make a master of names to pull from

• Hello!
You can use the VLOOKUP function to extract the name by number. See this article for examples and instructions.

22. Arley says:

Sir, let me apologize ahead of time for the incoherent attempt to describe the problem...

I am attempting to have two columns that contain specific text (drop down selection) yield a result based on the multiple combination of options. I am trying to get develop a formula that uses the specific text with multiple variations results in generating new text based on the two cells. Looking below you can see there are multiple combinations that will results in RAC 1, RAC 2, RAC 3, and RAC 4.

In short the goal is to select the probability and Severity rating then the RAC Code will auto-populate based on the available combinations.

Probability Severity RAC Code
I Catastrophic (A) Frequent RAC 1
I Catastrophic (B) Likely RAC 1
(II) Critical (A) Frequent RAC 1
(I) Catastrophic (C) Occasional RAC 2
(I) Catastrophic (D) Seldom RAC 2
(II) Critical (B) Likely RAC 2
(II) Critical (C) Occasional RAC 2
(III) Moderate (A) Frequent RAC 2
(III) Moderate (B) Likely RAC 2
(III) Moderate (C) Occasional RAC 2
I Catastrophic (E) Unlikely RAC 3
(II) Critical (D) Seldom RAC 3
(IV) Negligible (A) Frequent RAC 3
(II) Critical (E) Unlikely RAC 4
(III) Moderate (D) Seldom RAC 4
(III) Moderate (E) Unlikely RAC 4
(IV) Negligible (B) Likely RAC 4
(IV) Negligible (C) Occasional RAC 4
(IV) Negligible (D) Seldom RAC 4
(IV) Negligible (E) Unlikely RAC 4

This was my attempt however it populates the RAC without both cells populated.
=IFS(AND(AND(H2="(I) Catastrophic",I2="(B) Likely"),AND(H2="(I) Catastrophic",I2="(A) Frequent"),OR(H2="(II) Critical",I2="(A) Frequent")),"RAC 1",(OR(AND(H2="(I) Catastrophic",I2="(C) Occasional"),AND(H2="(I) Catastrophic",I2="(D) Seldom"),AND(H2="(II) Critical",I2="(B) Likely"),AND(H2="(II) Critical",I2="(C) Occasional"),AND(H2="(III) Moderate",I2="(A) Frequent"),AND(H2="(III) Moderate",I2="(B) Likely"),OR(H2="(III) Moderate",I2="(C) Occasional"))),"RAC 2",(OR(AND(H2="(I) Catastrophic ",I2="(E) Unlikely"),AND(H2="(II) Critical",I2="(D) Seldom"),OR(H2="(IV) Negligible",I2="(A) Frequent "))),"RAC 3",(OR(AND(H2="(II) Critical",I2="(E) Unlikely"),AND(H2="(III) Moderate",I2="(D) Seldom"),AND(H2="(III) Moderate",I2="(E) Unlikely"), AND(H2="(IV) Negligible",I2="(B) Likely"),AND(H2="(IV) Negligible",I2="(C) Occasional"),AND(H2="(IV) Negligible",I2="(D) Seldom"),OR(H2="(IV) Negligible",I2="(E) Unlikely "))),"RAC 4")

23. John Louvis says:

What function I will be using to perform a nested if condition between 2 excel CHAR function.

• Hi!
The CHAR function returns a character by its code. What you want to do with two CHAR functions - I can't guess.

24. Ngalaku says:

Hi Albeit Team,

Thanks for a great article. I have a range of data showing a merchant's transactions performed through a platform that we'll call FastExpress broken down in a sample below (the original data has over 10,000 entries):

PAID_LOCAL STATUS CURRENCY AMOUNT COUNTRY_CODE CARD COMPANY
01/04/2019 success USD 1,956.00 US Mastercard
02/04/2019 failed USD 2,390.57 GH Mastercard
02/04/2019 success USD 1,201.06 GB AmEx
02/04/2019 success USD 5,201.06 GB AmEx

The Card company takes it fees, FastEx takes theirs and then pays the merchant
The Card company & FastEx has the below fees:

Mastercard = 1% for local transactions (done in US) and 1.5% for foreign transactions if fees are below \$200 then 2% and 2.5% respectively for fees equal to or above \$200

AmEx = 1.2% for local transactions (done in US) and 1.7% for foreign transactions if fees are below \$200 then 2.2% and 2.7% respectively for fees equal to or above \$200

FastEx = 0.8% for local transactions (done in US) and 1.3% for foreign transactions if fees are below \$200 then 1.8% and 2.3% respectively for fees equal to or above \$200

Please note that fees are capped at \$180 maximum for local transactions

and would like calculate how much is due to pay the Card Company, how much for FastEx and the net payment to the merchant
Not sure if the IF function would best suit this computation as every attempt kept getting confusing and complex.

Hoping to hear from you.
Thanks!

25. Maja M says:

Hi.
I am trying to create a formula with this information:

If Date A - Date B (check-in and check-out date for guests) are lower than 20.6.2022 or higher than 31.8.2022 the statement is true, value should be "low" if they are between those dates (so higher than 20.6 and lower than 31.8) then "high".

I tried:
=IF(AND(B4=DATEVALUE("31.8.2022"), D4=DATEVALUE("31.8.2022")), "low", "high")
But it doesn't really work. Help would be apreciated.

• Hello!
To specify a date, you can use the DATE function:

=IF(AND(B4 > = DATE(2022,6,22),D4 < = DATE(2022,8,31)),"low","High")

• Maja M says:

Hi, me again :)

But what if I want to make it even more complicated.
Instead of 2 "seasons" I want to use 3.

So for example.
1.4. - 20.5.2022 = low
21.5 - 30.6.2022 = mid
1.7 - 31.8.2022 = high
1.9 - 30.9 = mid
1.10 - 31.10 = low again

I tried with IFS but it gets complicated because it has to check 2 times or maybe I'm just useless when it comes to this.
Or maybe it can't be done.
I would appreciate the help.

• Hi!
Use the AND and OR operators in your IF function. I recommend this guide: Excel IF statement with multiple AND/OR conditions.

=IF(OR(AND(B4>=DATE(2022,4,1),D4<=DATE(2022,5,20)), AND(B4>=DATE(2022,10,1),D4<=DATE(2022,10,31))),"low", IF(OR(AND(B4>=DATE(2022,5,21),D4<=DATE(2022,6,20)), AND(B4>=DATE(2022,9,1),D4<=DATE(2022,9,30))),"mid", IF(AND(B4>=DATE(2022,7,1),D4<=DATE(2022,8,31)),"High","")))

I hope this will help.

26. Anonimous says:

Hi! Do you have any propositions for a formula that would both work for extracting the name and surname from these rows in a singe cell

21-Feb-2022 requested by Suvarna, Rashmita21-Feb-2022 completed by dbgURL provided just too long with the coding to accept
17-Feb-2022 Requested by Chacko, Alphonsa21-Feb-2022 Completed by SPVersion Update Request
21-FEB-2022: Request by Alonso Nunez, Marta21-FEB-2022: Completed by BOT

For instance, should extract Suvarna, Rashmita as a result from the first row

• Hi!
The surname is not even a separate word. I don't think it can be done with a formula.

27. Talat Nawaz says:

if the amount is 350000 than bonus 100 and than amount is 351000 per thousand 1 plus 350000=100 and 351000= 101, 353000= 103

• Hi!
Sorry, I don't understand what you want to calculate. Explain more.

28. Naveed says:

I need the formula Like ( Block code B-218 in sheet 3 times and amount 100 x 3 = 300 ) now another cell have different block code and values i need if block code B-218 has no payment or not found then give Outstanding if the all data is there then calculate all amount sum 300 however these value and block code in different cell.

29. Tony says:

Please I would like to know how I can set an automated text on one excel sheet if a value is found in another sheet. If a value is found in sheet one, then I should get a text as ''done'' on the other sheet where that value is.

30. BALDEV M C says:

A B C D E F G
1 NO. NAME PAN TEL NO. PERSON ADRESS PROOF EMAIL ID
2 1 BALDEV ABCDE12345F 99999 AMIT DDEGE12345C BALDEV@G.COM
3 2 SURESH CDEFG12345A 88888 RAKESH CCCCC12345C SURESH@G.COM
4 3 AMIT DDEGE12345C 77777 SURESH CDEFG12345A AMIT@G.COM
5 4 DEEPAK AAAAA12345A 66666 MAHESH BBBBB12345B DEEPAK@G.COM
6 5 MAHESH BBBBB12345B 55555 DEEPAK AAAAA12345A MAHESH@G.COM
7 6 RAKESH CCCCC12345C 44444 BALDEV ABCDE12345F RAKESH@G.COM

=VLOOKUP(C2,\$C\$2:\$G\$7,4,FALSE) DDEGE12345C

NOTE:- I Neen Answer as BALDEV@G.COM [EMIAL ID]

• Hi!
I don't understand what formula helps you want. The value DDEGE12345C is in columns 2 and 5 of your range. Is this the problem?

31. Chaudhary Hamza Akhtar says:

I am trying to apply a formula to the cell if a specific cell contains specific text like D8 contains the total amount of project order and E8 contains the status of order ether it is completed canceled or under revision. In F8, I want to use IF Formula in such a way that if E8=completed then it will apply the formula to get the value of 80% of the D8 Our Actual Profit, rest 20% is our cost of work) but if the text is not equal to completed then the value should be 0. How can it be possible? I am trying this formula but getting error (=IF(E8=Completed,"(D8/100)*80", "0")).

Thanks.

• Sandeep says:

Put the string to compare in "". Like =IF(E8="Completed",D8*0.8,)
Try this.

32. Will says:

Is it possible to use IF Function (or what other function) on my case?
If value is less than or equal 0 type "True" but if greater than it will just show the number as is? Thanks

• Hi!
Yes, you can use the IF function.

IF(A1<=0,TRUE,A1)

33. Shafi says:

Hello sir,

Project status of Open and closed using conditional format was done. Now i want to conclude all these in a overall project status like if all closed it shows closed, if any one open , it shows Open...Like that,,,pls help me

• Hello!

=IF(SUM(--(A2:A20="Open")),"Open","Closed")

34. David says:

I am trying to set up an IF where it check a cell to see if an ‘X’ is there. I can set up for it to check for numbers, but if I put =IF(A1=‘X’,1,0) it gives me an error code.

• Hello!
I don't really understand what you want to do. To check numbers, you need a separate IF formula. Or create a nested IF formula for multiple conditions, as described in this guide.

35. Jonas says:

Hi,

it is possible to write a formula for this task.

In A1 I have text "v:part1:neg:vn:undef:neutr|būti=nebūtina" and so on everytime with ending "=text". I want that formula would type that "text" into B1. Text in all the lines is different.

Thank you.

• Hi!
I am not sure I fully understand what you mean. If you want to split a text into cells, read this guide. If I didn't guess, please describe in detail the result you want to get.

• Jonas says:

Hi,

I read that guide but don't have "split text" option.
I need to split the text into cells after equal sign. So if I have a text in cell A1 "v:part1:neg:vn:undef:neutr|būti=nebūtina", I need the word after equal sign to appear in cell B1 "nebūtina".

36. Antoinette de Beer says:

Hi.

I need to do a formula.

I have the following columns:

Status, Date offer accepted, actual start date, Client driven hold, requisition cancel date.

In the status column, we have the following on a dropdown list (all different colours)
Filled Not Yet Started
Closed
Did Not Fill
Partially Filled
On Hold
Cancelled

I need to do a formula where it will automatically choose one of the options on the dropdown (above) by inputting a date in the column and change to that colour on the status column.

• Hello!
Automatic selection of a value in a drop-down list is only possible using a VBA macro.

37. Ankitkumar Hemraj Dhingra says:

Hi Sir,

I am facing a challenge to come to find a formula for the below issue. I hope if you can help me sort it out.

I have lot of data in word format (its the syllabus for children) and I want to convert the same in Excel format to make it attractive to children. I used Left, MID, Right formulas, but the last word some times come incompletes in the sentence, do you know what can be done to skip the incomplete word in the end of the sentence and to get that in the next line.

I know it doesn't looks straight forward, but whenever you have a solution, it would be appreciated if you would share it with me. Thanks in advance.

• Hi!
The information you provided is not enough to understand your case and give you any advice. For me to be able to help you better, please specify which formula you mean and describe the problem in more detail.

38. Rob Steward says:

Good evening,

I am in grad school and we had a test that asked if the following formula was wrong. =IF(\$A1="Yes","1","0")

I put this in excel and gave it a set of data under column A and went from row 1-10 using yes and no. The formula worked correctly, however, I am told I was wrong and the formula wouldn't work because you are not allowed to put quotation marks on numbers in an IF statement.

Is not using quotations on numbers in an IF statement his opinion or is it a fact? If it is fact, then why does the formula still work with the given data set?

• Hello!
The quotes mean that the number is written as text. Your formula will return the number as text. The numbers in quotes follow the syntax of the IF function and are not an error in using it. However, keep in mind that with these numbers you will not be able to perform mathematical calculations, since they are already text. However, there is no prohibition in Excel to use quotes with numbers.

• Rob Steward says:

Thank you for your time on the reply. I now understand why I gave the wrong answer.

39. § says:

why
=IF(A1;"text";"") - returns "text" if a1 has any data and blank if a1 is blank

but

=IF(AND(A1;DAY(A1)1);"text";"") - returns "text" if a1 is blank or has data, and blank only if day(a1) is 1

=IF(AND(A1"";DAY(A1)1);"text";"") - works as intended

what am i missing?

• Hi!

40. vijay says:

1 6
2 8
3 12
4 12
5 15
6 18
I want If formula 1st Row Data
2nd Row Formula Requierd kinldy Share IF formula

41. GOPI says:

Hai Sir,

i need a formula for Marks to percentage,

if the percentage is below 1% mark is 5

if the percentage is 1% to 3% mark is 10

if the percentage above 3% to 5% mark is 15

if the percentage above 5% mark is 20....

42. Flick says:

I'm trying to come up with a formula that will input words, so if a number is below 30 it will say "within 30 days then if it's between 30-365 it will say "within 12 months and anything over 365 will be blank. so far I can do the first part but I'm not sure how to add another condition.

=IF(E6<30, "within 30 days")

43. Lars says:

I want to make a formula that goes something like this

Sorry I'm a real novice in excel. :-(

Hope somebody can help me out.

\Lars

• Hello!

=IF(SUM(--(G3:L3<>""))=0,M3+80,0)
or
=IF(SUM(--(G3:L3=""))=6,M3+80,0)

Hope this is what you need.

44. jan says:

hi, i am trying to do a formula where the following occurs

if the balance is greater than 37500 (say 50,000) then the excess 12500 needs to be multiplied by 40% and the original 37500 needs to be multiplied by 20%

if its less than 37500 then only that balance needs to be multiplied by 20%

i have tried a few IF formulas but they only do part of the task

• Hello!

=IF(A1>37500,(A1-37500)*40%+37500*20%,A1*20%)

45. Marshall Alfred Opare says:

How do i return a result to be good or bad from a list of numbers

• Hi!
Describe in detail what problem you have, and I will try to help you.

HI,
can anyone help me to set a formula with data validate I have three conditions in my data validation list Present Absent and Paid Leave which is denoted With P, A, and PL, what I want when my leave balance is equal to zero and then I select PL then popup message appeared no leave balance

• Hi!
You cannot get a popup message using the usual Excel formula. Need to use VBA macro

47. ANAND KUMAR JHA says:

A B C D
TOTAY

346 INV-0354 30/06/2021 18901.52 =+IF(TODAY-B346>90<180,D346,0)
347 INV-0355 30/06/2021 1330.20
348 INV-0356 30/06/2021 2861.50

• Hi!
Also, make sure you use the TODAY function correctly.

=IF(AND(TODAY()-B346>90,TODAY()-B346<180),D346,0)

48. Abraham Crowe says:

I am Trying to Use the Value(Text) in Cell E to determine the the condition in cell I to read (Pass, Fail) based on the Value(numerical) in field G. Example. IF E = Gram, Eight, Quarter, Half and G Numerical Value fits a given field then I = Pass or Fail. The Value in E will Determine if the Value in G is True. The True/Pass parameters for G will be Gram >=1.08 ,=3.7, =7.27, =14.16, <=14.4. As long as Cell G Falls Between these ranges for the appropriate value in Cell E then Cell I should show Pass. IF outside these then Fail.

• Hi!
But conditions >=1.08 ,=3.7, =7.27, =14.16, <=14.4 cannot be met at the same time. I recommend leaving two conditions: >=1.08, <=14.4

49. tara says:

I want to write an if formula that if the cell has a number >0 to return a certain value, if the cell has text to return it as zero.

Example I have a time card Monday = 8 , Tuesday= FO, Wednesday = 8, Thursday =8, Friday = 8. I am trying to say everyday the person works they get an extra 2 minutes of pay. currently I have multiple if functions stating =if cell >0, 2,0 but the cell with the FO text is getting the true statement.

• Hello!
To determine the content of a cell, you can use the ISNUMBER and ISTEXT functions.

=IF(ISTEXT(A1),0,2)

or

=IF(ISNUMBER(A1),2,0)

50. D.B. says:

Hello,

i need a formula, that says: IF =H3-J3>0, and iF =H3-J3<0,121 (then it is ok),
but: IF =H3-J30,121 (then rise or lower the G3 cell so it can be in the parameters from 0 to 0,121).

If this is possible.

• D.B. says:

Something is wrong. So i will send the question in 2 parts.

1. part

i need a formula, that says: IF =H3-J3>0, and iF =H3-J3<0,121 (then it is ok).

• D.B. says:

2. part

but: IF =H3-J30,121 (then rise or lower the G3 cell so it can be in the parameters from 0 to 0,121).

• D.B. says:

again it is not good...grrr

51. Zilha Pari says:

i need a formula that if cell B3 is "A" then put the 5% in cell D3????????

• Hi!
Formula in cell D3:

=IF(B3="A",5%,"")

Hello,

While creating a time sheet that will auto calculate an invoice amount I have tried the above, referencing the "IF formula to perform a math operation and return a result".

My data comes from a drop down list. I want the particular cell to say "ok, if this cell says "client A", then do this math formula in this other cell". The problem is, each of the names in my drop down list corresponds to a different percentage rate to multiply the payrate by in order to get the bill rate..make sense? So if the worker had x hours working for client A I want to be able to choose client A from the drop down list, manually enter the pay rate for that employee, and then have the sheet calculate the OT pay rate, regular bill rate, OT bill rate and total it all at the bottom to show what the invoice should be. I have all of the other work done, I just cannot seem to get past this part, and I wonder if I am trying to get Excel to do too much with too little. Please help.

Here is how I have entered the formula.

Client A Client B Client C pay rate
=IF(AND(OR('Dropdown Lists'!A30,'Dropdown Lists'!A34,'Dropdown Lists'!A50)), N17 + N17*45%)

• Hello!
You can automatically find and insert the interest rate for the selected customer into a cell using the VLOOKUP function, as described in this article.
I hope this will help, otherwise please do not hesitate to contact me anytime.

53. David says:

Hello,

Is it possible to make a formula so that IF cell A is Province ( Ontario, Alberta, Yukon, Manitobia ....) then multiply cell B Number with cell C (2%,3%,9%.... ?

basically trying to calculate taxes depending on province.

• Hello!

=IF(A1="Ontario",B1*2%,IF(A1="Alberta",B1*3%,""))

You can use the IFS function for multiple conditions:

=IFS(A1="Ontario",B1*2%,A1="Alberta",B1*3%)

If the province's list and percentages are in columns D and E, you can find the percentage you want using the VLOOKUP function:

=B1*VLOOKUP(A1,D1:E10,2,0)

54. Aria says:

Hello,

Is it possible to use a formula that says if CO or CM then 8?
I'm keeping a score at work with my coworkers and how many days they've worked and how many days they've had pto (CO) or medical (CM). i need the formula to work for 30-31 entries per persona (the days of the month) and i need something when i put cm or co in the table to return 8 back as in hours not worked. is it possible? am i making any sense?

• Aria says:

Oh. Forgot to mention. As i have 31 columns in a row, if there are more than 1 CO to sum them up. for example if i have 3 CO then the answer given should be 24. is it possible?

• Hello!
Pay attention to the COUNTIF function. Please check out this article to learn how to count cells with multiple criteria (OR logic).
The result you get is multiplied by 8.

• Aria says:

Thank you so much! I managed to make it work. You're awesome!

55. Jenn says:

Forecasting spreadsheet: There are start and end dates for each project. I want the corresponding dated cells to color fill based on if they fall between the start and end dates. If I change the date, I want it to automatically change the fill. No fill if outside of dates. Ex: Start 2/25/2021 End 8/30/2021. Cells dated 2/25/2021 to 8/30/2021 will be filled. If I change date, it will change fill.

=IF(\$K39="TBD",2,IF(AND(\$L39=AH\$1),IF(\$G39="OH",1,5),0))

56. Cassandra Acosta says:

I'm trying to write a formula where if b4 is \$14000 and is greater than c4 which is \$10000 then the amount in c4 (\$10000) needs to be displayed in d4. Could you please offer some assistance.

Thank you

• Hi!
The formula for your conditions may look like this:

=IF(B4>14000,C4,"")

If B4> 14000, then B4 will always be greater than C4, where 10000 is written. Therefore, the second condition does not make sense.

57. Humble says:

I want the formula such that value_if_false wouldn't affect other cells when I drag the formula dowwards

58. mazlan says:

Hi,

I need help in Excel cell. I want a result from 2 conditions. if the cell i type 5 the answer is 100 and if i type 10 the anwer is 300 on the same cell. how to do using IF or other formula?

• Hello!
If I understand correctly, you want to write both the value and the formula in one cell. It's impossible. You need to use a VBA macro. If the formula and the value 5 or 10 are in different cells, use a nested IF function.

59. Shougata Bose says:

Is it possible to get substracted value with suffix/test.
to be precise,
i want to get the following,

10:00 PM-04:00 PM=06:00 hrs
after subtraction i get 06:00, but not with hrs. I want to get with hrs "suffix".
thanks

60. Shougata Bose says:

I want to do the following work with IF function,
If(A2=A-620,"Bose",""); can i do it.
here A-620 is Mr. Bose's ID number.

• Hello!
Use quotation marks when comparing cell values to the text.

If(A2="A-620",”Bose”,””)

61. khoro Avhavhoni Tshivhula says:

if a2 is >1 check if the date on b2 is > date on a1 and return yes if all statements are true no if false

62. Thir says:

How do I do something like an IF with a random test and one of the outputs is the same random like this:

=IF(random_number>0.5,same_random_number,0)

I hope you know what I'm saying cause I don't.

• Thir says:

Oh, wait I figured it out myself. Never mind.

Thanks anyway!

• Hello!

63. Jay says:

HI,

I want to make a formula in which the value of A1 is less than or equal to 10, A2 will show "1" but if A1 is greater than 10 say 12 for example the excess 2 will multiplied to 0.5 then A2 will be 10+(X*0.5)/A1

=IF(A1>=10,"10+0.5X"&FIXED(A1-10,0),1)

• Hello!
Please check the formula below, it should work for you:

=IF(A1>10,10+FIXED(A1-10,0)*0.5,1)

64. Natnael says:

Hi,
i need a formula to do the following calculations:
IF A2 and A3 are blank then to return blank but if there are values greater than zero to multiply A2*A3

• Hi!

65. Anonymous says:

(auto result req)
Packing sr no no of box
D1 to D2 2
D3 to d5 3
D5 to D9 4
as per above example i want auto sum in excel for packing sr no

66. Lloyd says:

I need help with the below given formula. It has two sells to chose from. Cell AE5 is a date. The output required is taht if the date in AE% is lower than today then output cell should read "Note Due", However if the other cell that is AF5 is blank then output required is "Not Received" and if it is not blance the the output required is "Received"

If the date criteia is satisfied then i do not want further output of "Not Received" or "Received"

• Hello!
If my understanding is correct, you can use this formula:

• Lloyd says:

Dear Mr. Trifuntov,
Thank you for your revert. You have made it amazingly simple. Sincerely appreciate. It fits well and resolves my query with exception to scenerio under option 4. The final formula i am using is:

In the outputs below Amount is AD5 , Date due on is AE5, Received on is AF5 and output cell is the column marked Status that is AG5. Under option 4 we receive the amount before the due date. We wanted to give a preference that if the amount is received before due date then output should show "Received" instead of showing "Not Due". Would it be possible to incorporate such preference in the formula.

Output 1
Amount Date Status

Output 2
Amount Date Status

Output 3
Amount Date Status
200,000 30-11-21 Not Due

Output 4
Amount Date Status
200,000 30-11-21 29-10-21 Not Due

67. Mathew says:

Hi, i am trying to create an IF function that when you have typed "DONE", the exact date when the word was typed will be reflected on another cell. Whilst when "ONGOING" is typed, the date shown will be the date today, and will still continue only until the word DONE is typed. Thanks for the help.

• Hi!
Excel functions can only change values in the cell with which they are written.

68. Chris Wong says:

Hi,

URGENT

I am in urgent need to a formula to help me update a current file with new COGS and RRP pricing.

But not all articles under a certain category need to be updated. So if I filtered original file to a specific category and did a VLOOKUP, will any data on not filtered rows change also if row numbers are not in running order and skips rows?

Basically, I only want to update some articles with new data and retain existing data for those articles not on new data file.

Thanking you.

Chris

69. Moamen says:

what if I want to use VLOOKUP but the value is a specific word in the cell
I mean the formula have to find text first and then make it value

• Hi!
Your issue is not clear. Explain in more detail.

70. Robert says:

Hi, I am tracking 'aging overdue invoices', and I am creating an IF statement formula where it finds the total per days outstanding. My database output provides the days outstanding and many ROWS I get the text "NULL". All overdue days list correctly on second column with current formula. How can I insert the TEXT "NULL" on "column B" Aging Bucket when "Column A" reads NULL?

Here is my current formula inserted on "Column "Aging Bucket" ROW "B2":

=IF(A2>90,"91-120 Days Past Due ",IF(A2>60,"61-90 Days Past Due",IF(A2>15,"16-30 Days Past due",IF(A2>-0.1,"0-15 Days Past Due","0 Current"))))

My current data output:

Column A

Days_Overdue
NULL
NULL
280
19

Column B

Aging Bucket
181-365+ Days Past Due
181-365+ Days Past Due
181-365+ Days Past Due
0-30 Current

• Hello!
A NULL error occurs when the ranges you specify do not overlap. You can replace the error with any value, including the text "NULL", using the IFERROR function.

71. MUBANIBASHA says:

Hi

Please could someone help me I am trying to create the following

EX:
If M2 is less or equal to 0.01-0.99 return the text in cell N2 "0"

EX:

iF M2 is less 12 return the N2 "12" and above 12, 13 14 is return N2 12,13,14.

72. steven says:

How should I type if the value is between 1-200, it types 40%;
201-300 type 15%;
301-600 type 10%;
601-900 type 5%

Thank you

73. Alison says:

Hi,
I'm trying to find the right function to give me the following.
For any price that is a full number, give me back 'reg price', ex. 5.00
for any price ending with .98, give me back 'mkdn price', ex. 4.98.

Can anyone help?
Thanks,
Alison

• Hello!
I don't understand what you want to do. Give an example of source data and desired result.

Hello,

I'm using an IF function so that if the ranking in table A is either 9, 10 or 11, we shall output the performance from another corresponding, yet separate table of data and leave blank if otherwise.

The formula looks like:
=IF(P166=9,AP166,"")&IF(P166=10,AP166,"")&IF(P166=11,AP166,"")

This has worked to the point where the correct corresponding performance data has been outputted, however, these are in decimal format and it will not allow me to change these to a percentage format (despite allowing me to select the 'percentage option', nothing changes). Furthermore, I cannot alter the number of decimal points that the newly outputted data is displayed to.

As the data is essentially the same, I thought this might not be too big of an issue. However, when I go to find the average of the 3 outputted performances, I get the error message:
#DIV/0!
Upon further digging, I found that when I go to simply sum up the three outputs, It gives me zero (when this shouldn't be the case).

It's almost as if the IF function output isn't being recognised by excel despite being visible (and correct) on my screen.

Any help is greatly appreciated, thanks!

75. Natalie B says:

Hi, I'm trying to use an IF function with an email address.

Example: =If(J3=123,name@domain.com,IF(j3=4567,anothername@domain.com,0))

I've tried using " " around the email addresses, but nothing works.

Thanks,

• Hello!
Always use quotation marks for text expressions. I don’t know what kind of result you wanted to get. If you wanted to get the email address as a hyperlink, then use the HYPERLINK function.

76. Mario says:

Hello,

I am unsure if this is possible though any assistance is appreciated.

I have cell B2 with the value 4 (YVL)

I am trying to write a formula that says IF(B2<10&" (YVL)","over","shift").

Is this possible?

• Mario says:

Hello gain,

Please ignore the above question. I tried a IF(COUNT(FIND formula and it seems to have worked.

cheers,

• Hi!
Use IF AND statement to check two conditions:

=IF(AND(--LEFT(A1,SEARCH(" ",A1,1))<10,MID(A1,SEARCH("(",A1)+1,3)="YVL"),"over","shift")

77. Loraine says:

Hi, thank you for share all of functions above. This helped me a lot, ^^.

78. Dusan says:

Hi guys, i need help with something. I checked this text and cant find out if something like i need can be done in excel or not...

For example, i have 12 values in dropdown menu in a cell (data validation) and i would like if i can set up something that when i change value from dropdown menu, excel can input predefined text (2 options only) in predetermined field.

For example, if i select P-3340 from dropdown menu, i would like for excel to change cell below into From well.

Can something like that be done? I actually dont need eny calculations, just that when i select something from dropdown menu, it changes next cell or two. I do a lot of repetitive reports and this would save a ton of time.

• Hi!
The drop-down list writes the selected value from this list to the cell.
You cannot solve your problem using standard Excel tools.

79. Ana says:

I'm trying to writ and IF statement that compares 2 cells with dates in them.

IF( F4= A\$1,B\$1,M3)
A1=a date pulled in via a VLOOKUP formula and is dynamic
F4=09/15/2021
F5=F4+1
F6=F5+1
ect.

I tried the following:

=IF(DATEVALUE(F4)=DATEVALUE(A\$1),B\$1,M3)

But I got an Error, any suggestions?

• Ana says:

Also tried =IF(DATEVALUE(9/15/2021)=DATEVALUE(E\$4),K\$4,L6)

• Hello!
The DATEVALUE function only works with dates that are written as text. You do have not a text in the F4 cell, but the date.
Try formula

=IF(F4=A\$1,B\$1,M3)

80. Nia says:

if 150.00 if the zero cents it will choose the cell d2
if 150.50 then will choose the d4.

How will i do that?

Thank you

• Hi!
To get the fractional part of a number, use the INT function:

=A1-INT(A1)

Use this formula in an IF function as described earlier in this article.

81. Sherry says:

Hi, how do you program a cell to fill itself with "1" based on the given date range? I have all dates in one row and in the column I have employee names.

• Hi!
I am not sure I fully understand what you mean. Give an example of your data and an example of the result you want to get.

82. Sasha says:

hi,

the values in my cell are "<90", the if formal hasn't been picking up on this and is returning the second condition for all cases
Is there anyway to fix this?

• Hi!

83. Balasaravanan Palanirajh says:

Thank you very much
I've learnt a lot more here than in class
I was able to find what was needed then and there
Thank you once again
Good job, you all

84. Matthew Ammerman says:

Hi! I could use some help if anyone is available.

I have 2 sheets that contain the same column called "Content Title".

Sheet 2 has an additional column with data in it called "Total Unique Users". I want to bring over the data from Sheet 2 column "Total Unique Users" to Sheet 1 if I can find the same Content Title in Sheet 1.

For example, If Content Title in Sheet 1 is equal in Sheet 2, pull the data from the "Total Unique Users" column in Sheet 2 into Sheet 1.

Any help is appreciated. Thank you!

85. Mr David Richman says:

I have 2 columns of numbers , cOL C&D . I need Col A to represent a letter based on these criteria.
If C is greater than D then show text H else show A

I have =IF(\$C\$3>\$D\$3,"H","A") this works OK but if the numbers match I need to show text D. How can I do this please..

• Hello!
You can use this formula:

=IF(C3>D3,"H",IF(C3=D3,"D","A"))

• Mr David Richman says:

Thanks so much for your FAST solution - it works great.. in fact you are 'Alexander the great'.

86. Annette says:

Hi,
I'm trying to use formula in a budget where
C3 D3 (\$eg) E3(monthly)
yearly \$95000 = D3/12
monthly \$500 = D3*1
weekly \$50 = D3*4

Please assist with e3 cell formulas

Regards
Annette

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

=IF(C3="yearly",D3/12,IF(C3="monthly",D3,IF(C3="weekly",D3*4,"")))

87. Bird says:

I want to write a statement in sheet named Master, that reads a cell in sheet named 2021 and if it says N, come back with NO. If it is blank, I want it to come back with a blank. If it is anything else, I want it to give me the value in another cell in sheet 2021. How do I do this? I have tried a bunch of different IF functions and everything comes back with an error.

• Hello!
Use a formula like this:

=IF('2021'!B1="N","No",IF('2021'!B1="","",'2021'!B2))

88. James Veleno says:

To everyone, I need help.
Column A1: John Doe
Column A2: Jim Doe
Column A3: James Doe
...

So, columns B should be:
Column B1: 12345
Column B2: 23456
Column B3: 34567

John is 12345, Jim is 23456, James is 34567.
How to make formula that puts their numbers when I put their names?

89. Richar Wooley says:

Working on setting up a asset inventory sheet using existing bar codes,

I can get the Barcode to scan insert Barcode number and insert scan date. But I also need it to search the spreadsheet for a matching barcode, and update the scanned date with the current date.

Present code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim x As Integer
For x = 2 To 1000
If Cells(x, 1).Value "" And Cells(x, 2).Value = "" Then
Cells(x, 2).Value = Date & " " & Time

Cells(x, 2).NumberFormat = "m/d/yyyy h:mm AM/PM"

End If

Next

Range("B:B").EntireColumn.AutoFit
End Sub

Would like to have it to where I scan in one Cell and have it search for exsisting data match or append @ the end of the rows.

90. Danielle says:

=(IF(N191.4,N191.7,N192.4,"NORA"))))
Hello!
I would like to write a formula saying:

if N191.4 and N191.7 and N192.4 write NORA

91. Danielle says:

=IF(N191.4,N19<1.7, "PA"))
Hello, This formula enters False or True instead of PA when the value is between 1.4 and 1.7.

92. Donnette Stanley says:

I have spent hours and cannot figure this out. I have a spreadsheet with contract numbers and material numbers, a second tab has the same information contract numbers and material numbers but it includes a line for each shipment. I am trying to come up with a formula that counts the number of shipments, So anything greater than 0 that matches the contract number and the material number count as 1. I cannot figure it out: =COUNifs('Aug 2021'!E:E,">0",'Aug 2021'!J:J,D2,'Aug 2021'!I:I,E2) This is the closest I have gotten and it comes up with the #name?

• Hi!
If you write the name of the COUNTIFS function correctly, then I think there will be no error.

93. Mike Excell says:

I don't understand why my if statement does not work. I am searching for age based on year in 2 digit format. 98, 02, 13 ect. The year for the exercise is 2014. The formula I wrote follows:

=IF(F6<14, 14-F6, 114-F6)

The results all come back 14-F6 no matter if the value is above or below 14. but if it is above 14 shouldn't the function follow the false result function of 114-F6?

Does a have to be equated to zero specifically or something. I finally got the function to work with =IF(F6-14>0, 100-F6+14, 14-F6) but that seems like a lot of extra steps compared to my first equation.

• Hello!
What are the values recorded in F6? Are these values written as number, date, or text? The value 02 is text and cannot be compared to a number. Specify your question.

94. Laurent says:

Hello, I'm wondering if you can help me? Looking to create a formula to simply identify currency 'EUR' or 'USD' in source column, to then compute exchange rate for that currency in next column. I have been trying to use the 'IF' function, but it doesn't work. For example:

Column A: 'EUR' or 'USD'
Column B: =IF(A1=EUR,"4.50","3.67")

However this is giving me #NAME? error.

Was wondering if you had any suggestions?
Thanks!

• Hi!

=IF(A1="EUR",4.50,3.67)

95. LS says:

I have one column where hours will be put. If one day has zero hours, I want another column on same day to put DYO, and in a third column for it to put day off, and all other columns to remain blank. This will all remain on one date or line. I would like it all done based on that one column having zero. Any ideas on formula?

96. Toba Fawekun says:

Hello, I have this formula that works individually but will like to have it as a single formula.
=IF(L6="SUPPRESSED", (EDATE(N6,11).
=IF(L6="UNSUPPRESSED", (EDATE(N6,3).
In my table, the L column returned "Suppressed" if the value connected to its formula is 1000. So I want a single formula the will return (EDATE(N6,11) and (EDATE(N6,3) if the L column returned "Suppressed" or "Unsuppressed".

97. AJ says:

Hi everyone,

Please could someone help me I am trying to create the following

If M2 is less or equal to 0-0.99 return the text in cell N2 "0"
If M2 is less or equal to 1.00-1.99 return the text in cell N2 "1"
If M2 is less or equal to 2.00-2.99 return the text in cell N2 "2"
If M2 is less or equal to 3.00-3.99 return the text in cell N2 "3"
If M2 is less or equal to 4.00-4.99 return the text in cell N2 "4"
If M2 is less or equal to 5.00-5.99 return the text in cell N2 "5"
If M2 is less or equal to 6.00-6.99 return the text in cell N2 "6"
If M2 is less or equal to 7.00-7.99 return the text in cell N2 "7"
If M2 is less or equal to 8.00-8.99 return the text in cell N2 "8"
If M2 is less or equal to 9.00-9.49 return the text in cell N2 "9"
If M2 is less or equal to 9.50-9.99 return the text in cell N2 "10B"
If M2 is equal to 10.00 return the text in cell N2 "10A"

Any help would be hugely appreciated.

• Hello!
The formula below will do the trick for you:

=IF(INT(M2)<9,INT(M2),IF(ROUND(M2,2)<9.5,9,IF(ROUND(M2,2)<10,"10B","10A")))

• AJ says:

Thank you Alex!

98. Nixon Omblero Canedo says:

Trans. Date Type of Customers Due Date

06/10/21 Regular 06/25/21
06/10/21 Consignment 06/17/21

Note:

1) What is the formula to add 15 days from the date of transaction

99. Evanlog says:

Good

100. Allison says:

Hi. I am trying to create a formula that compares a single cell to an entire column(unlimited number) of data. Basically I have a tracking # in a cell and need to compare that to a column consisting of tracking #'s that have been shipped(I will be continuously adding to this column). I want to create a column that lets me know if that tracking # in a cell has been shipped.
So I was tried using formula:
=if(C9=I:I,"Shipped","Freezer")

But it doesn't not work. even though that cell(C9) matches a number in I:I, it will not display shipped and only displays freezer instead.

• Hello!
The IF function does not work with ranges. Please use the following formula

=IF(ISNUMBER(MATCH(C9,I:I,0)),"Shipped","Freezer")