Excel IF statement with multiple conditions

The tutorial shows how to create multiple IF statements in Excel with AND as well as OR logic. Also, you will learn how to use IF together with other Excel functions.

In the first part of our Excel IF tutorial, we looked at how to construct a simple IF statement with one condition for text, numbers, dates, blanks and non-blanks. For powerful data analysis, however, you may often need to evaluate multiple conditions at a time. The below formula examples will show you the most effective ways to do this.

How to use IF function with multiple conditions

In essence, there are two types of the IF formula with multiple criteria based on the AND / OR logic. Consequently, in the logical test of your IF formula, you should use one of these functions:

  • AND function - returns TRUE if all the conditions are met; FALSE otherwise.
  • OR function - returns TRUE if any single condition is met; FALSE otherwise.

To better illustrate the point, let's investigate some real-life formulas examples.

Excel IF statement with multiple conditions (AND logic)

The generic formula of Excel IF with two or more conditions is this:

IF(AND(condition1, condition2, …), value_if_true, value_if_false)

Translated into a human language, the formula says: If condition 1 is true AND condition 2 is true, return value_if_true; else return value_if_false.

Suppose you have a table listing the scores of two tests in columns B and C. To pass the final exam, a student must have both scores greater than 50.

For the logical test, you use the following AND statement: AND(B2>50, C2>50)

If both conditions are true, the formula will return "Pass"; if any condition is false - "Fail".

=IF(AND(B2>50, B2>50), "Pass", "Fail")

Easy, isn't it? The screenshot below proves that our Excel IF /AND formula works right: Excel IF statement with multiple AND conditions

In a similar manner, you can use the Excel IF function with multiple text conditions.

For instance, to output "Good" if both B2 and C2 are greater than 50, "Bad" otherwise, the formula is:

=IF(AND(B2="pass", C2="pass"), "Good!", "Bad") Excel IF function with multiple text conditions

Important note! The AND function checks all the conditions, even if the already tested one(s) evaluated to FALSE. Such behavior is a bit unusual since in most of programming languages, subsequent conditions are not tested if any of the previous tests has returned FALSE.

In practice, a seemingly correct IF statement may result in an error because of this specificity. For example, the below formula would return #DIV/0! ("divide by zero" error) if cell A2 is equal to 0:

=IF(AND(A2<>0, (1/A2)>0.5),"Good", "Bad")

The avoid this, you should use a nested IF function:

=IF(A2<>0, IF((1/A2)>0.5, "Good", "Bad"), "Bad")

For more information, please see IF AND formula in Excel.

Excel IF function with multiple conditions (OR logic)

To do one thing if any condition is met, otherwise do something else, use this combination of the IF and OR functions:

IF(OR(condition1, condition2, …), value_if_true, value_if_false)

The difference from the IF / AND formula discussed above is that Excel returns TRUE if any of the specified conditions is true.

So, if in the previous formula, we use OR instead of AND:

=IF(OR(B2>50, B2>50), "Pass", "Fail")

Then anyone who has more than 50 points in either exam will get "Pass" in column D. With such conditions, our students have a better chance to pass the final exam (Yvette being particularly unlucky failing by just 1 point :) Excel IF function with multiple OR conditions

Tip. In case you are creating a multiple IF statement with text and testing a value in one cell with the OR logic (i.e. a cell can be "this" or "that"), then you can build a more compact formula using an array constant.

For example, to mark a sale as "closed" if cell B2 is either "delivered" or "paid", the formula is:

=IF(OR(B2={"delivered", "paid"}), "Closed", "")

More formula examples can be found in Excel IF OR function.

IF with multiple AND & OR statements

If your task requires evaluating several sets of multiple conditions, you will have to utilize both AND & OR functions at a time.

In our sample table, suppose you have the following criteria for checking the exam results:

  • Condition 1: exam1>50 and exam2>50
  • Condition 2: exam1>40 and exam2>60

If either of the conditions is met, the final exam is deemed passed.

At first sight, the formula seems a little tricky, but in fact it is not! You just express each of the above conditions as an AND statement and nest them in the OR function (since it's not necessary to meet both conditions, either will suffice):

OR(AND(B2>50, C2>50), AND(B2>40, C2>60)

Then, use the OR function for the logical test of IF and supply the desired value_if_true and value_if_false values. As the result, you get the following IF formula with multiple AND / OR conditions:

=IF(OR(AND(B2>50, C2>50), AND(B2>40, C2>60), "Pass", "Fail")

The screenshot below indicates that we've done the formula right: IF with multiple AND & OR statements

Naturally, you are not limited to using only two AND/OR functions in your IF formulas. You can use as many of them as your business logic requires, provided that:

  • In Excel 2007 and higher, you have no more than 255 arguments, and the total length of the IF formula does not exceed 8,192 characters.
  • In Excel 2003 and lower, there are no more than 30 arguments, and the total length of your IF formula does not exceed 1,024 characters.

Nested IF statement to check multiple logical tests

If you want to evaluate multiple logical tests within a single formula, then you can nest several functions one into another. Such functions are called nested IF functions. They prove particularly useful when you wish to return different values depending on the logical tests' results.

Here's a typical example: suppose you want to qualify the students' achievements as "Good", "Satisfactory" and "Poor" based on the following scores:

  • Good: 60 or more (>=60)
  • Satisfactory: between 40 and 60 (>40 and <60)
  • Poor: 40 or less (<=40)

Before writing a formula, consider the order of functions you are going to nest. Excel will evaluate the logical tests in the order they appear in the formula. Once a condition evaluates to TRUE, the subsequent conditions are not tested, meaning the formula stops after the first TRUE result.

In our case, the functions are arranged from largest to smallest:

=IF(B2>=60, "Good", IF(B2>40, "Satisfactory", "Poor"))

Naturally, you can nest more functions if needed (up to 64 in modern versions). Nested IF statement in Excel

For more information, please see How to use multiple nested IF statements in Excel.

Excel IF array formula with multiple conditions

Another way to get an Excel IF to test multiple conditions is by using an array formula.

To evaluate conditions with the AND logic, use the asterisk:

IF(condition1) * (condition2) * …, value_if_true, value_if_false)

To test conditions with the OR logic, use the plus sign:

IF(condition1) + (condition2) + …, value_if_true, value_if_false)

To complete an array formula correctly, press the Ctrl + Shift + Enter keys together. In Excel 365 and Excel 2021, this also works as a regular formula due to support for dynamic arrays.

For example, to get "Pass" if both B2 and C2 are greater than 50, the formula is:

=IF((B2>50) * (C2>50), "Pass", "Fail") IF array formula with multiple AND conditions

In my Excel 365, a normal formula works just fine (as you can see in the screenshots above). In Excel 2019 and lower, remember to make it an array formula by using the Ctrl + Shift + Enter shortcut.

To evaluate multiple conditions with the OR logic, the formula is:

=IF((B2>50) + (C2>50), "Pass", "Fail") IF array formula with multiple OR conditions

Using IF together with other functions

This section explains how to use IF in combination with other Excel functions and what benefits this gives to you.

Example 1. If #N/A error in VLOOKUP

When VLOOKUP or other lookup function cannot find something, it returns a #N/A error. To make your tables look nicer, you can return zero, blank, or specific text if #N/A. For this, use this generic formula:

IF(ISNA(VLOOKUP(…)), value_if_na, VLOOKUP(…))

For example:

If #N/A return 0:

If the lookup value in E1 is not found, the formula returns zero.

=IF(ISNA(VLOOKUP(E1, A2:B10, 2,FALSE )), 0, VLOOKUP(E1, A2:B10, 2, FALSE))

If #N/A return blank:

If the lookup value is not found, the formula returns nothing (an empty string).

=IF(ISNA(VLOOKUP(E1, A2:B10, 2,FALSE )), "", VLOOKUP(E1, A2:B10, 2, FALSE))

If #N/A return certain text:

If the lookup value is not found, the formula returns specific text.

=IF(ISNA(VLOOKUP(E1, A2:B10, 2,FALSE )), "Not found", VLOOKUP(E1, A2:B10, 2, FALSE)) If #N/A error in VLOOKUP

For more formula examples, please see VLOOKUP with IF statement in Excel.

Example 2. IF with SUM, AVERAGE, MIN and MAX functions

To sum cell values based on certain criteria, Excel provides the SUMIF and SUMIFS functions.

In some situations, your business logic may require including the SUM function in the logical test of IF. For example, to return different text labels depending on the sum of the values in B2 and C2, the formula is:

=IF(SUM(B2:C2)>130, "Good", IF(SUM(B2:C2)>110, "Satisfactory", "Poor"))

If the sum is greater than 130, the result is "good"; if greater than 110 – "satisfactory', if 110 or lower – "poor". Using the IF function with SUM

In a similar fashion, you can embed the AVERAGE function in the logical test of IF and return different labels based on the average score:

=IF(AVERAGE(B2:C2)>65, "Good", IF(AVERAGE(B2:C2)>55, "Satisfactory", "Poor"))

Assuming the total score is in column D, you can identify the highest and lowest values with the help of the MAX and MIN functions:

=IF(D2=MAX($D$2:$D$10), "Best result", "")

=IF(D2=MAX($D$2:$D$10), "Best result", "")

To have both labels in one column, nest the above functions one into another:

=IF(D2=MAX($D$2:$D$10), "Best result", IF(D2=MIN($D$2:$D$10), "Worst result", "")) Using IF together with the MIN and MAX functions

Likewise, you can use IF together with your custom functions. For example, you can combine it with GetCellColor or GetCellFontColor to return different results based on a cell color.

In addition, Excel provides a number of functions to calculate data based on conditions. For detailed formula examples, please check out the following tutorials:

  • COUNTIF - count cells that meet a condition
  • COUNTIFS - count cells with multiple criteria
  • SUMIF - conditionally sum cells
  • SUMIFS - sum cells with multiple criteria

Example 3. IF with ISNUMBER, ISTEXT and ISBLANK

To identify text, numbers and blank cells, Microsoft Excel provides special functions such as ISTEXT, ISNUMBER and ISBLANK. By placing them in the logical tests of three nested IF statements, you can identify all different data types in one go:

=IF(ISTEXT(A2), "Text", IF(ISNUMBER(A2), "Number", IF(ISBLANK(A2), "Blank", ""))) IF with ISNUMBER, ISTEXT and ISBLANK

Example 4. IF and CONCATENATE

To output the result of IF and some text into one cell, use the CONCATENATE or CONCAT (in Excel 2016 - 365) and IF functions together. For example:

=CONCATENATE("You performed ", IF(B1>100,"fantastic!", IF(B1>50, "well", "poor")))

=CONCAT("You performed ", IF(B1>100,"fantastic!", IF(B1>50, "well", "poor")))

Looking at the screenshot below, you'll hardly need any explanation of what the formula does: Using IF and CONCATENATE

IF ISERROR / ISNA formula in Excel

The modern versions of Excel have special functions to trap errors and replace them with another calculation or predefined value - IFERROR (in Excel 2007 and later) and IFNA (in Excel 2013 and later). In earlier Excel versions, you can use the IF ISERROR and IF ISNA combinations instead.

The difference is that IFERROR and ISERROR handle all possible Excel errors, including #VALUE!, #N/A, #NAME?, #REF!, #NUM!, #DIV/0!, and #NULL!. While IFNA and ISNA specialize solely in #N/A errors.

For example, to replace the "divide by zero" error (#DIV/0!) with your custom text, you can use the following formula:

=IF(ISERROR(A2/B2), "N/A", A2/B2) Using IF together with ISERROR

And that's all I have to say about using the IF function in Excel. I thank you for reading and hope to see you on our blog next week!

Practice workbook for download

Excel IF multiple criteria - examples (.xlsx file)

4469 comments

  1. i have a cell containing data -100. i want to set conditional formatting that if data is equal to -100 then its color should be grey. =if(R5=-100, 0), but this is not working

  2. Hopefully this makes sense but there are 6 columns of data. The point is to use logic for Entry Date and Target Month to yield the right Target year. I am using logic that says if the Entry Date is within last 6 months of the year in that column AND the Target Month is one of the first six months of a year (1-6) then it is targeting the following year 2025. (i.e. A request is entered in September 2024 for something to be done in January of 2025).

    I am running into a case where this formula is not working on all cells and I cannot understand why. Example 1 is the issue. I use the AND( function but get one true and one false value. Both should be true for the AND( function to yield True, but they are not. Thus the AND( function is still showing True when it should report False, and my IF statement should yield the year 2024.

    Entry Target Month Target Year Validation 1 Validation2 AND Validation
    #1 - Incorrect Example 9/27/2024 December 2025 TRUE FALSE TRUE
    Formulas =IF(AND(MONTH(N178)>6,MONTH(1&(O178)6 =MONTH(1&O178)6,MONTH(1&(O178)6,MONTH(1&(O180)6 =MONTH(1&O180)6,MONTH(1&(O180)<7)

    1. Hello Erik!
      In the format of your formula, it is impossible to understand it and check its work. It is also unknown what values are written in these cells. Describe the problem in more detail.

      1. The formula in question was:
        "=IF(AND(MONTH(xxx)>6,MONTH(1&(yyy)6.

        However, I validated the second AND criteria and it was FALSE. Per the logic 1&December = 12, which is NOT <7, and thus false.

        But the result of my IF formula was the true value which is "2005". It should have said 2024. I cannot explain why. Does it only validate the first criteria and call it true?

        1. The formatting from this comment section is messing up my formula when I type it out. Hope the "" helps. See below.

          "=IF(AND(MONTH(xxx)>6,MONTH(1&(yyy)<7),2025,2024)"

          1. Hi! I don't know what data you are using, but this formula works correctly:

            =IF(AND(MONTH(A1)>6,MONTH(1&A2)<7),2025,2024)

  3. Hi Alexander!

    Trying to right a formula for an incentive payout.

    - If the column A shows Y, and column B is greater than or equal to 10 but less than 20 AND column C is greater than or equal to 10 but less than 20 then column D shows $10.
    - If the column A shows Y, and column B is greater than or equal to 20 but less than 35 AND column C is greater than or equal to 20 but less than 35 then column D shows $20.
    - If the column A shows Y, and column B is greater than or equal to 35 AND column C is greater than or equal to 35 then column D shows $30.

    This is what I came up with but it isn't working. (Different cell than my examples above): =if(or(E2=Y),IF(AND(D2>=10,D2=10,F2=20,D2=20,F2=35,F2>=35,30,0))))

    Thanks!

    1. Hello Lauren!
      For your task, you can use nested IF formula as described in this guide: Nested IF in Excel – formula with multiple conditions.
      However, I recommend paying attention to IFS function. For example:

      =IFS(AND(A1="y",B1>=10,B1<20,C1>=10,C1<20),10, AND(A1="y",B1>=20,B1<35,C1>=20,C1<35),20)

      For the detailed instructions, please see: Excel IFS function instead of multiple IF.
      Pay attention to the correct use of the AND function.

  4. Help...

    I want to write a formula that says if cell A1 contains "+" character in a code (ie ABC123+:1), in B1 write "PLUS", or if cell A1 contains "-" (ie ABC123-:1, in B1 write "MINUS" and if cell A1 contains neither of those write "BASIC"

    TIA

    1. Hi! To find a specific character in a text string, use these instructions: Excel FIND and SEARCH functions with formula examples. Use ISNUMBER function to use the result of the search in an IF formula. For example:

      =IF(ISNUMBER(SEARCH("+",A1)),"Plus", IF(ISNUMBER(SEARCH("-",A1)),"Minus","Basic"))

      Here is the article that may be helpful to you: Nested IF in Excel – formula with multiple conditions.
      For multiple conditions, you can also use the IFS function. Read more: Excel IFS function instead of multiple IF.

  5. I want to create a points table where points are awarded as under:

    if cell E2 is same as I2, 2
    if cell E2 is NR, 1
    if cell E2 is anything else, 0

    What would be the formula?

  6. Hi,
    I need to calcualte tax
    Week No Gross Pay COP 1 COP2 COP3
    0.5% 2% 3% 8%
    1 75.00 100.00 200.00 500.00 500.00+ 0.38 2.50 0.00
    2 150.00 100.00 200.00 500.00 0.50 0.00
    3 250.00 100.00 200.00 500.00 0.50 0.00
    4 510.00 100.00 200.00 500.00 0.50 0.00

    I need a formula, especially for the middle brackets (COP2 and COP3) that allows me to do calculations if the Gross Pay is between the amounts.
    I've tried an IF AND (GrossPay>COP1 <COP2), but I need a zero value for when the Gross Pay is smaller than the higher bracket as well.

    What combination of IF formulas would work best here? I can work out the rest of the formula just fine once I have the starting point.
    Thanks.

    1. Sorry, it messed up the table.
      The Cut-off-points and rates are COP1: 100€ @ 0.5%, COP2 200€@2%, COP 3 500 € @ 3%. Anything over 500 is 8%.

      1. Hi! Based on the information given, the formula could be as follows:

        =IF(B2>500,B2*8%,IF(B2>200,B2*3%,IF(B2>100,B2*2%,B2*0.5%)))

  7. How can I use IF function, the results to be in column
    If Column Result;

    The result in between then ;

    Condtions Results

    9-10 1
    18-20 2
    27-30 3
    36-40 4
    45-50 5
    55-60 6
    65-70 7

    Please provide the guideline

    Regards.

  8. Hi Im trying to get the formula to add VAT amount to the net amount but for different % values so in simple terms if E4 is £100 E5 is %5 or 20% what formula do I put in E6 to calculate the vat for each amount chosen?

  9. Dear Sir
    I am sending condition for formula pupose

    Business Value | >8% Growth on Previous Year |>10% Growth on Previous Year
    0-99999 0.00% 0.00% 0.00%
    100000-300000 0.50% 0.70%
    300001-1000000 0.60% 0.80%
    1000001-2000000 0.70% 0.90%
    2000001 & Above 0.80% 1.00%

    Pls give me soluction

  10. Hi, Pls guide me below condition use which formula Or send formula

    one is >100000 & 8% & >10% in that case he is applicable 0.50% eligible for 8% Growth & 0.70% eligible for <10% Growth

  11. i want to see if you can create a formula for below:

    if colmun F has any option from list 1 i want column G to display no and column H to display £0, but if column F has any option from list 2 i want colum g to display Yes and column H to show 1% of column E. however but then also if column F is blank i want Columns G-I to display nothing.

    1. Hi! I think you know that an Excel formula can only change the value in the cell in which it is written.
      Use a nested IF statement in cell G1. Look for the value in list 1 and list 2 using the MATCH function.
      For the detailed instructions, please see: Excel if match formula: check if two or more cells are equal.
      Based on the information given, the formula could be as follows:

      =IF(ISNUMBER(MATCH(F1,N9:N11,0)),"no",IF(ISNUMBER(MATCH(F1,P9:P17,0)),"Yes",""))

    2. list one is column n9-n11
      list two is column p9-p17

  12. if cell I16=B then cell O16=1,
    if cell I16=C then cell P16=1,
    if cell I16=UR then cell Q16=1

    1. Hi! An Excel formula cannot change a value in three cells at once. Create an IF formula in each of the cells. For example cell O16:

      =IF(I16="B",1,"")

  13. I need your help and thankful to you,
    I need to multiply the value with the criteria
    if a1>4 then multiply by 1
    if a1>5 less than 8 multiply be 2
    if a1> 9 than multiply by 3
    I need a single formula.

      1. Thanks a lot Sir for your response,
        I try the article but not succeeded kindly help me..

  14. PRICE INSURANCE
    550000
    664000
    766000
    1090000

    600000<=0.5%, 800000<=1%, 1000000<=2%
    Please solve this
    THANKS IN ADVANCE

  15. I am trying to pull data from one cell that has a lot of data.

    I want to do is easily pull out the specific number in one cell. Here is an actual example of some of the data that could be in ONE cell (the data is not always in this order):
    Cell A1 : 営業2G 張 JIES JP-S0502-00100BS-N0EPB-551-0000×4台 JIES-24-J01
    Cell A2 : 営業2G 張 JIEI-24-J0132/蘭盛-三門巨力 JP-S2002-00300BS-N0CCB-5

    The specific number I want to pull out :
    Number 100 before letter BS in Cell A1
    Number 300 before letter BS in Cell A2

    Kindly help me using excel formula for this

  16. Hi Alexander

    Awesome topics and examples you are showcasing

    I am trying to make an IF statement so that it tells me when values go past a threshold of -0.10% across 2 columns in the same row, either going down or going up:

    =IF(OR(AG344>=(0.1%),AH344<=(0.1%),"DISCLOSE"),IF(OR(AG344=(0.1%)),"DISCLOSE","UNCHANGED"))

    So far it is not working, revealing "DISCLOSE" even if the numbers across both columns are unchanged

    Can you please tell me where I am going wrong?

    Also, would it be possible to add additional thresholds on top of -0.10% such as -0.20%, -0.30% and so on:

    =IF(OR(AG344>=(0.1%),AH344<=(0.1%),"DISCLOSE"),IF(OR(AG344=(0.1%)),"DISCLOSE","UNCHANGED"))

    Many thanks in advance

    1. Hi! Based on your description, it is hard to completely understand your task. However, I’ll try to guess and offer you the following formula:

      =IF(OR(ABS(A1)>=0.1%,ABS(B1)>=0.1%),"DISCLOSE","UNCHANGED")

      The ABS function will return the absolute value of the number and ignore the + or - sign.
      If this is not what you wanted, please describe the problem in more detail.

      1. In addition to my comment earlier today, I tweaked the formula to incorporate more arguments. It appears to work, but rather than say DISCLOSE or UNCHANGED, it says TRUE or FALSE

        Can you please take a look at the below (separated by carriage return on each argument) and show me where I am going wrong?

        =OR(AND(AG1193>=-0.1%,AH1193<=-0.1%,"DISCLOSE"),OR(AND(AG1193=-0.1%),"DISCLOSE"),
        OR(AND(AG1193>=-0.2%,AH1193<=-0.2%,"DISCLOSE"),OR(AND(AG1193=-0.2%),"DISCLOSE"),
        OR(AND(AG1193>=-0.3%,AH1193<=-0.3%,"DISCLOSE"),OR(AND(AG1193=-0.3%),"DISCLOSE"),
        OR(AND(AG1193>=-0.4%,AH1193<=-0.4%,"DISCLOSE"),OR(AND(AG1193=-0.4%),"DISCLOSE"),
        OR(AND(AG1193>=-0.5%,AH1193<=-0.5%,"DISCLOSE"),OR(AND(AG1193=-0.5%),"DISCLOSE"),
        OR(AND(AG1193>=-0.6%,AH1193<=-0.6%,"DISCLOSE"),OR(AND(AG1193=-0.6%),"DISCLOSE"),
        OR(AND(AG1193>=-0.7%,AH1193<=-0.7%,"DISCLOSE"),OR(AND(AG1193=-0.7%),"DISCLOSE"),
        OR(AND(AG1193>=-0.8%,AH1193<=-0.8%,"DISCLOSE"),OR(AND(AG1193=-0.8%),"DISCLOSE"),
        OR(AND(AG1193>=-0.9%,AH1193<=-0.9%,"DISCLOSE"),OR(AND(AG1193=-0.9%),"DISCLOSE"),
        OR(AND(AG1193>=-1%,AH1193<=-1%,"DISCLOSE"),OR(AND(AG1193=-1%),"DISCLOSE"),
        OR(AND(AG1193>=-1.1%,AH1193<=-1.1%,"DISCLOSE"),OR(AND(AG1193=-1.1%),"DISCLOSE"),"UNCHANGED")))))))))))

      2. Thanks Alexander

        Apologies - it appears I did not articulate completely

        What I do is compare movements from one day to the next, looking out for any threshold crossings which are every 0.1%. So if we go down from 0.1 to 0.09 (or vice versa) then ideally we want to see that triggered. The same for 0.40 to 0.39, or 0.88 to 0.91 (upwards or downwards).

        It is always across 2 days that we are looking at

        I can send a screenshot via email if that makes it more clearer

        Thanks in advance!

        1. Hi! Sorry, I do not fully understand the task. Write an example of the source data and the expected result.

  17. if my Category is School then
    STD1 up to 3 and STD1A = 1 and STD1B = 1 and STD1C = 1
    OR
    STD2 = 1 STD1A = 1 and STD1B = 1 and STD1C = 1

    School Column reference is C44
    STD1 column reference is G44
    STD2 column reference is H44
    STD1A column reference is J44
    STD1B column reference is K44
    STD1C column refence is L44

    Formula i created is below but it is not giving the expected result
    =IF(OR(AND(C44="&C44&",G44>3,J44>3,K44>3,L44>1), AND(H44>1,J44>1,K44>1,L44>1)), "Pass","Fail")

    1. Hi! Based on your description, it is hard to completely understand your task. I can't guess with what you want to compare the value in cell C44 to and what C44=“&C44&” means. All other conditions in your formula always return FALSE for your data that you have written.

  18. I fill B2 with fixed date, B2 = 10/12/2024
    I use B3 as input date, and result must be appeared in B4.
    In B4, I write this formula, =IF(B3="x",0,IF(B3="","",IF(B3>B2,1,IF(B3<=B2,2,"")))).
    My problem is, if I insert alphabet other than x, the result is 1.
    I just want the result in B4 is 0 when I fill with x only.
    How to write correct formula / function?

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

      =IF(B3="x",0,IF(ISNUMBER(B3),IF(B3>B2,1,IF(B3<=B2,2,"")),""))

      ISNUMBER function returns FALSE if any text character is written in cell B3 or if B3 is empty.

  19. Hello,

    I am trying to get a separate cell to populate an additional 7 days entered from another cell if another cell is a Yes answer. If H23 is Yes (from a dropdown selection) I want H23 to add 7 (days) to the date entered in Cell H21. If Cell H23 is a No or Blank, then no additional data will be needed.
    Example: If H21 has 12/24/24 entered and H23 has a Yes, then H24 should then show 12/31/24

  20. Hi Sir, I have trying to "if formula with Full Columns but not apply. and also i use formula for = search under the mention the formula
    =If(search("filter",a1),"spare",if(Search("oill",a1),"lubricant","non OEM"))
    A column
    filters
    oil
    spray
    oil
    filter

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)