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)

4538 comments

  1. Please be so kind and support me with the formula:
    =IF(AND($K13;"";$N13;"";$O13;"");"No Risk";IF(AND($K13;"";$N13;"";O13;"");"Middle Risk"))
    Somehow it doesn't work and I get only "No Risk" based on first logical test.
    Thank you

    • Hello Olya!
      You used the same formulas for different IF conditions. Maybe you should use something like this formula

      =IF(AND($K13="",$N13="",$O13=""),"No Risk", IF(AND($K13<>"",$N13<>"",O13<>""),"Middle Risk",""))

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

  2. Hi
    I am trying to get multiple areas to display based on 2 or 3 chars. Tried this below formula but they are not returning the right Areas.Column F2 has a about 7-8 chars and i want to search the first 2 and 3 chars. Can you please help?
    Hope this makes sense. Thank you!

    =LOOKUP( LEFT(F2, 3), {"AL,N1,N2,N3,NW,EN","SL9,SL0,WD,HP","SG,LU,CM,CB,RM","GU,TW,KT,SL5,SL4","SL3,HA,UB"}, {"Area 1","Area 2","Area 3","Area 4","Area 5"})

    Below is the criteria
    GU Area 4
    TW Area 4
    KT Area 4
    SL9 Area 2
    SL3 Area 5
    SL0 Area 2
    SL2 Area 5
    SL5 Area 4
    SL4 Area 4
    SG Area 3
    LU Area 3
    CM Area 3
    CB Area 3
    RM Area 3
    WD Area 2
    HA Area 5
    UB Area 5
    HP Area 2
    EN Area 1
    NW Area 1
    N1 Area 1
    N2 Area 1
    N3 Area 1
    AL Area 1

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

      =CHOOSE(MATCH("*"&LEFT(F2, 3)&"*", {"AL ,N1 ,N2 ,N3 ,NW ,EN ","SL9,SL0,WD ,HP ","SG ,LU ,CM ,CB ,RM ","GU ,TW ,KT ,SL5,SL4","SL3,HA ,UB "},0), "Area 1","Area 2","Area 3","Area 4","Area 5")

      I hope this will help

      • This worked. I just had to change the F2,2 and will just have to ignore the 3 chars as this will complicate allot of it more. Thanks you again Alex.

  3. I am trying to make a column populate a specific rate based on criteria in the two columns before it.

    Column 1 is their name
    Column C is their insurance (BLTC or MCLTC)
    Column D is the level assigned (Level 1, Level 2, level 3)
    Column E is the rate per day we receive based on insurance and level as they are distinct. For example if you have BLTC and are a level 2 it would be $207.31. If you are MCLTC and level 2 is would be $200.07. I would like column 4 to auto populate based on insurance and level as the rates are specific by insurance and level.

    Can anyone help me with this? Thanks in advance!

  4. Hi I'm having troubles nesting all 4 formulas together. Is it possible? Please help!
    1) =IF(AND(BF2>=62,BH2>=5),"ELIGIBLE TO RETIRE", "not eligible to retire")
    2) =IF(AND(BF2>=60,BH2>=20),"ELIGIBLE TO RETIRE", "not eligible to retire")
    3) =IF(AND(BF2>=55,BH2>=30),"ELIGIBLE TO RETIRE", "not eligible to retire")
    4) =IF(AND(BF2>=55,BH2>=10),"ELIGIBLE TO RETIRE", "not eligible to retire")
    Example #1 (BF=Age)Age 63 with BH=yrs of svc)15 years of service - should be true for both 1 & 2 arguments
    Example #1 (BF=Age)Age 57 with BH=yrs of svc)15 years of service - should be true for argument 4

    • I figured it out. Just needed to read an earlier post you provided to someone else!! Thank you for all you do! All of you Excel gurus!! Have a great day!

      =IF(AND(BF2>=62,BH2>=5),"ELIGIBLE TO RETIRE",IF(AND(BF2>=60,BH2>=20),"ELIGIBLE TO RETIRE",IF(AND(BF2>=55,BH2>=30),"ELIGIBLE TO RETIRE",IF(AND(BF2>=55,BH2>=10),"ELIGIBLE TO RETIRE","not eligible to retire"))))

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

      =IF(OR(AND(BF2>=62,BH2>=5,AND(BF2>=60,BH2>=20),AND(BF2>=55,BH2>=10))),"ELIGIBLE TO RETIRE", "not eligible to retire")

      I hope it’ll be helpful.

  5. Hi,
    I really need your help, identifying the proble with my formula.

    if value range of is as bollow,
    For income range 20,000 to 29,999 ratio is 35% for type A, 30% for type B.
    and income range 30,000 to 49,999 ratio is 40% for type A, 35% for type B.
    Here,
    D9 = location of the cell which is a dropdown menue whether to choose A/ B
    G22 = location of the cell which is a used for input ranging from 0 - 50000
    H127 =

    =IF(AND(G22<30000,D9="A"),.35,IF(AND(30000<=G22,G22<50000,D9="A"),.40,IF(AND(G22<30000,D10="B"),.30,IF(AND(30000<=G22,G22<50000,D10="B"),.35,))))

    Thanks
    Nizam

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

      =IF(AND(G22 > 20000,G22 < 30000),IF(D9="A",0.35,IF(D9="B",0.3,0)),IF(AND(G22 > 30000,G22 < 50000), IF(D9="A",0.4,IF(D9="B",0.35,0)),0))

      I hope it’ll be helpful.

  6. Hi,
    I need your help with the below condition.
    If Cell B7=30000 then B9 should be 4(this value is in the cell H10)
    If Cell B7=50000 then B9 should be 4(this value is in the cell H11)
    If Cell B7=100000 then B8 should be 4(this value is in the cell H12)
    If Cell B7=150000 then B8 should be 5(this value is in the cell H13)
    If Cell B7=200000 then B8 should be 5(this value is in the cell H14)
    If Cell B7=330000 then B8 should be 4(this value is in the cell H15)
    If Cell B7=500000 then B8 should be 4(this value is in the cell H16)

    Kind regards
    Mohsin

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

      =IF(B7=30000,H10, IF(B7=50000,H11,IF(B7=100000,H12,IF(B7=150000,H13,IF(B7=200000,H14, IF(B7=330000,H15, IF(B7=500000,H16,"")))))))

      I hope it’ll be helpful.

  7. Hello Alexander,
    I want to decide the candidate is eligible or not, if the cell is contain NA or date ..how to write formula

  8. I am trying to calculate commission income. If gross commission is >220,000 then the net amount of commission they earn goes up. Here are my conditions:
    0-220,000 - .60
    220,001-440,000 - .65
    440,001-660,000 - .70
    660,001-880,000 - .75
    880,001+ - .80
    This is the formula I'm working with but it keeps coming back as #VALUE! =IF(OR(BR125>220001,BR125440001,BR125<=660000),BR8*BR4,"")
    What am I doing wrong?
    Thank you so much for your help, I'm ready to pull my hair out.
    Megan

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

      =IF(A1>880000,B1*0.8, IF(A1>660000,B1*0.75, IF(A1>440000,B1*0.7, IF(A1>220000,B1*0.65, B1*0.6))))

      Hope this is what you need.

      • You are a life saver! Guess I was making this harder than it needed to be. Thanks for getting me on the right track and thank you for taking the time to help all of us!

  9. Hi Can someone help me please?

    I am trying to put a formula for example if the Price is let's say £100 to be split into three columns like column one will be 0-£50
    Column two will be for anything that is above £50 but less or equal to £60
    Column three anything that is above £60 but less or equal to £70.
    Column four anything about £70.

    If any of the conditions don't meet let's say if column two is less than £50 to bring 0.
    Any help is much appreciated.
    Mita.

    • Hello Mita!
      I’m sorry but your task is not entirely clear to me.
      Please describe your problem in more detail. Include an example of the source data and the result you want to get. It’ll help me understand your request better and find a solution for you. Thank you.

  10. Hello, can you kindly help me with this formula? Been stuck on this for hours.

    Total amount: Cell E29
    Discount: >3000 -10% >5000 -15% >10000 -20%

    Formula written: =IF(E29>=3000,"E29*-0.1", IF(AND(E29>=5000,"E29*-0.15", IF(AND(E29>10000,"E29*-0.2","0")))))

    Thankyou for helping! Your help is very much appreciated!

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

      =-IF(E29>=10000,E29*0.2, IF(E29>=5000,E29*0.15, IF(E29>=3000,E29*0.1,0)))

      I hope this will help

  11. Hello, I am trying to accomplish a formula that is evaluating multiple cells to return a specific answer. I am using if/and but I cannot seem to get a does not contain to work? Here is my formula, the AE2 part is where it is failing. Any ideas?

    =IF(AND(K2="Parent",AQ2="Chassis",AE2"*DECOMM*"),"Chassis/Parent","NOT Chassis/Parent")

    Supposed to work a.... K2 = Parent and AQ2 = Chassis and AE2 does not contain DECOMM then return the false/positive value.

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

      =IF(AND(K2="Parent",AQ2="Chassis", ISERROR(FIND("DECOMM",AE2,1))),"Chassis/Parent","NOT Chassis/Parent")

      I hope it’ll be helpful.

      • Alexander, Thank you so much this worked perfectly!

  12. If column A is 1 then cell X If Column b is 1 then Cell Y otherwise C*D.
    Any help?

    • Hello Sean!
      Your conditions contradict each other. What if both column A = 1 and column B = 1? If both conditions are met? Read carefully the IF function with multiple conditions above.

  13. =IF(E2>=70, "Excellent", IF(E2>=60, "Good", IF(E2>40, "Satisfactory", "Poor ")))
    What are the best alternatives for this formula?
    I tried = If(AND...), / If(OR...) but couldn't get the expected result.
    Little help will be well appreciated.

  14. Hi, I really need help to add a final condition to this formula below, I have tried a few different things and just keep getting errors so any input would be great if it is possible
    =IF(AND(C3=$A$3,I3<1,"Y","N") BUT IF M3="Transfer Debit"=N

    • Hello Sabina!
      I’m sorry but your task is not entirely clear to me. Could you please describe it in more detail?
      What does it mean "IF M3="Transfer Debit"=N"??
      Thank you!

      • Hi Alexander, thanks for your quick response so basically I need to add an extra criteria to the formula. The first part is fine but the extra condition is basically but if cell M3 contains the text Transfer Debit change it to N... is this even possible? Or would it be a completely different formula?
        (summary of formula - If column C = A and column I < 1 = Y but if M3 = Transfer Debit N and everything else N).. hope this makes sense, sorry I'm not great at excel so might be why i am not very clear.

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

          =IF(M3="Transfer Debit","N", IF(AND(C3=$A$3,I3 < 1),"Y","N"))

          I hope this will help

          • Thank you so much, it worked!!!

  15. Total Taxable amount USD 10,00,000/-Tax free 3,00,000/- reducing balance 7,00,000/- 1st slab amount 1,00,0000/- How will i show in the row by formula 1,00,000/- next row 2,00,000/- next row 4,00,000/- (Auto reducing method not)

    I will be grateful if you help me
    YASIN

    • Hello!
      I’m sorry but your task is not entirely clear to me. For me to be able to help you better, please describe your task in more detail. Please specify what you were trying to find, what formula you used and what problem or error occurred. Give an example of the source data and the expected result.
      It’ll help me understand it better and find a solution for you. Thank you.

  16. Please help me, to generate IFs formula: given the situation, that I have 3 cases and fall into 80,000, the percentage should be 9% because it is below 100,000. Please help in formulating formula. I tried several times but I can't.
    Below are the conditions to be met.
    CASES 50000 75000 100,000 150000 200,000 250000
    1 2% 5% 10% 15% 21% 27%
    2 3% 7% 13% 20% 28% 35%
    3 4% 9% 17% 27% 35% 45%
    4 4% 9% 17% 27% 35% 45%
    5 4% 10% 19% 30% 38% 47%
    6 4% 10% 19% 30% 38% 47%
    7 5% 12% 22% 32% 40% 50%
    Hoping for your usual support on the matter.

  17. Hi, I want to take a table where column A is a simple numbered list, 1-10, and column B is the value corresponding to the number to it's left in that row, in column A. Then I want to automate my spreadsheet so that when I enter any number, 1-10, in column C, it returns the correct value from the table. I know how If and OR and INDEX work, but I cannot figure out how to create the command, which I am assuming will be a string of 10 nested commands, such as for my 1st entry in C1: "If(OR(A1=1,"B1"),(A1=2,"B2"),(A1=3,"B3"))...etc". Thanks!

    • Hello Peter!
      if you entered a number in cell C1, you can replace it with some other value only using the VBA macro. A cell can contain either a value or a formula. Depending on the value of C1, cell D1 can be changed.

  18. Hi I am working on a shift schedule where we have different shifts namely as follow:
    Shift: 1 - 06h00 - 14h00 = 6hours
    Shift: 2 - 14h00 - 20h00 = 6hours
    Shift: 3 - 20h00 - 06h00 = 10hours
    Shift: 4 - 08h00 - 17h00 = 9hours
    Shift: + - 06h00 - 10h00 & 16h00 - 20h00 = 8hours
    Shift: N - 18h00 - 06h00 = 12hours
    or if employee is off then it will be a Letter O and that should equal to 0
    So the idea is that should an employee work a shift on say block C9, whether it is any of the above shifts that it automatically gives the hours on the on say block K9.
    So I tried the following formula but it simple does not work.
    =IF(C9=1;6;0)OR(IF(C9=2;6;0;)(IF(C9=3;10;0)(IF(C9=4;9;0)(IF(C9=+;8;0)(IF(C9=N;12;0)(IF(C9=O;0;0)
    Not to sure if I explained it correctly, but hope you can help with this.

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

      =IF(OR(C9=1,C9=2),6, IF(C9=3,10, IF(C9=4,9, IF(C9=""+"",8, IF(C9=""N"",12, IF(C9=""O"",0,0))))))

      Hope this is what you need.

  19. Hi,
    Can you help for following condition.

    If P3 is >0.05 then P3-0.05
    If P3 is <-0.05 then P3+0.05
    if P3 is in between 0.05 and -0.05 then PASSED

    HOW TO WRITE FORMULA

    THANKS :)

    • =IF(P3>0.05,P3-0.05,IF(P3<-0.05,P3+0.05,"Passed"))

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

      =IF(P3 > 0.05,P3-0.05, IF(P3 < -0.05,P3+0.05, "PASSED" ) )

      I hope this will help

  20. =IF((AND(H6,H8,H11)="Valid"),"Valid","Invalid")
    Can you please identify the problem
    I am trying to pass on a text" Valid" when all 3 cells display "Valid" otherwise "Invalid"

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