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. My query is that in marksheet or data sheet some cell are empty and i want that i only write student name and blank cell with subject show automatically.

  2. I'm not sure if this has already been asked before but I am looking for a formula with both And and OR I believe that is looking at 3 different cells to have 4 different outcomes. with numbers between a certain figure
    if a1,b1,c1 is less than 5 and less than 240 then it is letter if a1,b1,c1 is less than 26 and less than 353 it is Large letter and then if it a1,b1,c1 is less than 160 and less than 450 it is Packet? if over 160 and 450 then box.
    Thank you for your time.

    • Hello!
      I’m sorry but your task is not entirely clear to me. Could you please describe it in more detail? What result do you want to get? Thank you!

      • I would like 1 formula to display whether entering 3 dimensions (a1,b1,c1=25,150,350) if 1 of the cells is less than 5 and another is less than 240 it brings back "Letter" if 1 of the cells is less than 26 and another is less than 353 then it brings back "Large letter" if 1 of the cells is less than 160 and another is less 450 then it brings back "Packet" and if it has 1 cell over 450 then it is "box".

  3. If an excel sheet acetic acid 15kg, another sheet acitic acid, how i correct spell automatically acetic acid for collect information through vlook up formula from a sheet where 15 kg have.this type of problems i face continuously when i work big data. Pls give me solution

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

  4. Hello, this site has some great tutorials, but I'm stuck with a problem I can't find a solution to. Hoping you can assist. I have a table showing values month over month, like this:
    A1=project number
    B1=Project name
    C1=October budget
    D1=November budget
    E1=December budget
    What I would like to do is verify the values month over month and if it is the same it replace the value with $0, if it is more than the previous month, it shows the difference, if it is blank it shows the previous month as a negative loss, if it is less, it shows the difference as a negative. A bit convoluted but I feel the solution is just out of my reach!
    L.

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

  5. I want if b2=1,20% (1+1)*10
    if b2=2,50% (2+1+2)*10
    if b2=3,90% (3+1+3+2)*10 continue to n number how to possible?

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

  6. N4=IF(G4=1,"H4+I4-L4",IF(G4=2,"H4+I4",IF(G4=3,"H4")))

    Incase of G4=1 Output come, H4+I4-L4 instead of numerical value
    Incase of G4=2 Output come, H4+I4 instead of numerical value
    ...........
    Is there any problem with my if formula? why i dont get numerical value on N Column?

  7. Good Morning! im trying to write a formula that looks at a frequency eg. 6 months, 1 year, 2 year, 5 years and if its X add that number to date inserted in a seperate column. so A would be 1 year, B would be "test date" and C "Due Date" currently have the below, but isn't working.
    =IF(OR(E17="1 Year",EDATE(L17,12)),IF(E17="2 Years",EDATE(L17,24)),IF(E17="5 Years",EDATE(L17,60)))
    Thanks in advance.

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

      =IF(E17="1 Year",EDATE(L17,12),IF(E17="2 Years", EDATE(L17,24),IF(E17="5 Years",EDATE(L17,60))))

      I hope this will help

  8. Hello, greetings for the day, my problem is i want to write a formula a1 has 350000 and a2 has 13000 and in the cell a3 i want to write like this if a1 < 500000 and also a2 greater than 12500 then a3 should be a2-12500. how can i do this? and if a1 400000 and a2 11000 and a3 should be a2 cause it is less than 12500. to the point if a2 is greater 12500 then it(a3) should be after deducting 12500 and if it(a2) is less than 12500 it can be that amount but primary condition is a1 must not have more than 500000. answer to this question is highly appreciated. Thank you in advance.

  9. I need to apply formula for Cell A1, to find its 70% or 10000 whichever is less

  10. Hi Alex! Hope all is well and that you could assist me with my Index formula as it's currently not working. I'm trying to use the index formula where it matches the keyword & returns the category. Unfortunately it's not working and hoping that you could assist.

    Data
    Post Date Check Description Debit Credit
    07/24/2020 SHINE MEDICAL 21022.00
    07/24/2020 TA INSTRUMENTS-W DIR-DEPT 7200.00
    07/24/2020 ORBITAL SCIENCES EFT 25594.00
    07/24/2020 THE BOEING CO BCAGPAYSVC 16480.00
    Formula
    Balance
    {=INDEX(K2:K15,MATCH(TRUE,ISNUMBER(SEARCH(J2:J15,C2)),0))}

    Keyword
    SHINE MEDICAL
    TA INSTRUMENTS-W DIR-DEPT
    ORBITAL SCIENCES EFT
    THE BOEING CO BCAGPAYSVC
    UNEX DISB
    CHECK NUMBER

    Categories
    WIRE
    WIRE
    WIRE
    WIRE
    WIRE
    CHECKS PAID

  11. hello, i would need a bit of a help with formula.
    in sheet1 in column A i have names, they are starting from row 3. in row 2 starting from column B i have numbers from 1 to 31.
    numbers represent dates. so i am filling that table with "1" when someone is there and i leave cell empty when that person was not working that day.

    now hard part.
    sheet 2
    there i need some formula here i will be able to pick number/date and that formula to show me who was working on that day. then to print them, and to pick another date/number.

    thanks

    • for first 2 dates i have done something like this
      =IF(D2=1,IF(Sheet1!D4=1,Sheet1!C4,""),IF(D2=2,IF(Sheet1!E4=1,Sheet1!C4,""),""))
      do i have to do same for all 31 dates or is there something easier?

  12. Hello! I cannot figure out the formula to "FLAG" a row for if each of the following conditions is not met:
    - If e2= "TRUE", then c2="TRUE" and d2="TRUE"
    - If d2= "TRUE", then c2="TRUE"
    - If c2= "FALSE", then d2="FALSE" and "e2="FALSE"
    - If c2= "TRUE"and either f2 OR g2="TRUE", then d2="TRUE"

    Please let me know if you can help! Thank you

    • Hello!
      Please describe your problem in more detail. It’ll help me understand it better and find a solution for you. Thank you.

  13. Hi, I have a table of data & want a formula to find all the orders which have both a basin and a PEP :
    IN052816 FRT FRT
    IN052816 BASIN VBAML55MSMNO
    IN052816 PKG PEP
    IN052817 FRT FRT
    IN052817 BASIN VB-BAR-48-NO
    IN052817 PKG PEP
    IN052817 ACC NONSTOCK
    I have tried pulling all the basins to a separate tab & using the following formula: =IF((AND(K:K=PEP!K:K,PEP!M:M="PEP")), "Pass", "Fail") (K is IN (1st) column, M is PEP (3rd) column) but all it comes up with is FAIL
    Please help!

    • Hello Sally!
      I’m sorry but your task is not entirely clear to me. Could you please describe it in more detail?
      Is your data recorded in one cell or in several?
      There is not a single value in the sample data to find BOTH basin AND PEP. Each of the lines contains OR the first, OR the second.

      • Hi Alexander, thank you for getting back to me.
        The original data is in one tab A-AF 1-29808, with each item on its own line & column (sorry the post above doesn't look like it).
        I appreciate the Basin & the PEP are on separate lines, I thought I could use the invoice number to determine the number of times they appear together as one invoice number would appear multiple times relating to each item on the invoice (K). I couldn't think of a way from this to find how many times a PEP (M) was on the same invoice as a Basin, so I copied all the Basins (L) onto one tab, and the PEP's onto another tab and tried the formula above on the basin tab, looking to the PEP tab to find a match.
        Column K = Invoice Number
        Column L = Category - Basin
        Column M = Item - PEP
        Does that help you understand what I am trying to do? and what data I am working with?
        Thanks
        Sally

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

          =IFERROR(INDEX(K1:K20, SMALL(IF("BASINPEP"=L1:L20&$M$1:$M$20,ROW(K1:K20)-0), ROW(INDIRECT("1:"&ROWS(K1:K20))))),"")

          This is an array formula and it needs to be entered via Ctrl + Shift + Enter, not just Enter.
          If your table has header rows, replace 0 in the formula with the number of those rows.

  14. I am trying to create a formula for my spreadsheet for multiple ITEM in a single cell
    If there is a "29" in a cell, then formula will D1+E1,
    If there is a "31" in a cell, then formula will D1
    If there is a "32" in a cell, then formula will D1+E1-F1
    ...........

    Here 29,31,32 ... etc area type fabricated rebar size in civil construction.
    so i use following formla
    =IF(H1=29,"D1+E1",IF(H1=31,"D1",IF(H1=32,"D1+E1-F1")))
    For 29 answer shows "D1+E1" instead of (D1=5+E1=7)=12

    Please help!

    • Hello!
      You named the condition "If there is a“ 29 ”in a cell, then formula will D1 + E1". This condition is written in your formula.
      Why do you expect "(D1 = 5 + E1 = 7) = 12" to be executed (I don't really understand what this expression means)?

      • Hello, Can you help me solve this?

        I need a formula in cell C5 that does the following:
        IF A1+B1 4 but 9 but 15, return $75
        Thanks!

        • Hello!
          Sorry, it's not quite clear what you are trying to achieve. Could you please describe it in more detail? What result do you want to get? Give an example of the source data and the expected result.

    • Hi,
      The reason it is showing D1+E1 is because you put it quotation marks.
      just put D1+E1.

  15. Hi! I need to convert the following from Google Sheets to work in Excel
    =ifs(N9=1,I9/10,N9=2,I9/100,N9=3,I9/1000,N9>3,I9/10000)

  16. Hi,
    Hope you are doing well.
    I wanted to know what is the formula used to derive how many sequences a person has carried out each day. Below is my example..Everyday the person will enter his/her start no. and end of the day the closing no. and i needs to check how many sequences each person has done.

    Thread Tester Seq Started Seq Completed Total Seq.Executed
    MOT-FST-83 MEETA 1 5 5
    MOT-ITM-146 AK-2 0 0 0
    MOT-ITM-147 LD-4 5 5 1
    MOT-ITM-148 LD-3 1 1 1
    MOT-MSA-17 LD-1 33 36 4
    MOT-MSA-18 AK-1 35 36 2
    MOT-MSA-20 AS-2 4 6 3
    MOT-MSA-21 MB-3 6 6 1

    • Hello Linda!
      To calculate the amount for each person, use the SUMIF function. Use the person's name as a criterion for counting. Read the detailed instructions in this article.
      I hope this will help, otherwise please do not hesitate to contact me anytime.

  17. Hi,
    My Name is Pradeep ,I need help for example state and brand wise subscriber count data in a sheet .so my requirement is .
    1st Condition ---
    If I select only state one name then subscriber total count show only selected state sum of count .
    2nd Condition ---
    If state and town then subscriber total count show only selected state and town sum of count.
    3rd Condition ---
    If state and town any name both are no select then subscriber total sum of count show.
    Date for your reference ---
    State Brand Total
    Ayodhya IDEA 188
    Ayodhya Voda 4189
    Gorakhpur IDEA 541
    Gorakhpur Voda 3994
    Kanpur IDEA 2072
    Kanpur Voda 8248
    Lucknow IDEA 1739
    Lucknow Voda 21211
    Prayagraj IDEA 723
    Prayagraj Voda 5028
    Varanasi IDEA 898
    Varanasi Voda 5496
    I am waiting your reply ..

    Thanks
    Pradeep

  18. Hello,

    I'm trying to determing which shipping containers were unloaded within the expected allocated time based on the number of pieces in the container. I have the total time it took to unload the containers in question and the amount of pcs on the containers. What formula can I use to determine if the container was unloaded within the threshold set based of the container pieces?

    Hoping someone can help me!

    < or = 399 pieces = 60 - 120 min per container
    400 - 899 pieces = 120 - 180 min per container
    900 - 1100 pieces = 180 - 240 min per container

    • Hello Alex!
      Please try the following formula:

      =IF(A1<=399,IF(B1*60*24<=120,"Yes","No"), IF(A1<=899,IF(B1*60*24<=180,"Yes","No"), IF(A1<=1100,IF(B1*60*24<=240,"Yes","No"),"")))

      Cell B1 contains the execution time of the operation in the time format "hh:mm:ss"
      Hope this is what you need.

  19. Hello
    I'm looking for a way to create a formula or macro that will check the value or entry in a column then have it enter the results based on the formula/macro in 2 different columns.
    Example
    Column A Column B Column C
    12345 212456 230456
    12366 217456 (null or blank)

    For the above the criteria it would be IF column A = 12345 then column B = 21256 and column C = 230456
    The data in column A is large with over 300 possible numbers.

    • Hello James!
      The information presented to you is not enough to give you advice.
      You didn't say anything about the verification criteria. But an Excel formula can only enter a value in one cell.

  20. Hello Alexander!
    I wonder if you can help me?
    I have a nested IF formula which works fine;
    =IFERROR(IF(Homepage!$L$4="Asda",'CPA - Hotspots Asda'!B12,IF(Homepage!$L$4="Tesco",'CPA - Hotspots Tesco'!B12,IF(Homepage!$L$4="Boots",'CPA - Hotspots Boots'!B12,IF(Homepage!$L$4="Field",'CPA - Hotspots Field'!B12,IF(Homepage!$L$4="Ireland",'CPA - Hotspots Ireland'!B12,IF(Homepage!$L$4="Morrisons",'CPA - Hotspots Morrisons'!B12,IF(Homepage!$L$4="Sainsburys",'CPA - Hotspots Sainsburys'!B12,IF(Homepage!$L$4="Sainsburys Trial",'CPA - Hotspots Sainsburys Trial'!B12,IF(Homepage!$L$4="Savers",'CPA - Hotspots Savers'!B12,IF(Homepage!$L$4="Superdrug",'CPA - Hotspots Superdrug'!B12,IF(Homepage!$L$4="Wilko",'CPA - Hotspots Wilko'!B12))))))))))),"")

    I now however need to add another element to this whereby even if L4 on the homepage states "Asda", if B28 states "No", I need it to direct to a different sheet, but if it states "Yes" it continues to pull from B12 on the 'CPA - Hotspots - Asda' sheet, and then I also need this to continue for each individual If statement. Is this possible at all? Thanks

    • Hello Leena!
      It is very difficult to understand a formula that contains unique references to your workbook worksheets. For the same reason, I cannot check her work.
      If I understand your task correctly, you can change the formula

      =IF(AND(Homepage!$L$4=”Asda”, B28="Yes"), [your formula], IF(AND(Homepage!$L$4=”Asda”, B28="No"),[direct to a different sheet],""))

      I hope it’ll be helpful.

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