SOLVED
Home

using IF(ISERROR) statements with true/false outcome in an IF statement

%3CLINGO-SUB%20id%3D%22lingo-sub-325108%22%20slang%3D%22en-US%22%3Eusing%20IF(ISERROR)%20statements%20with%20true%2Ffalse%20outcome%20in%20an%20IF%20statement%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-325108%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20and%20Greetings%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20two%20formulas%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIF(ISERROR(VLOOKUP(D6%2C'SKU%20list'!J%3AJ%2C1%2CFALSE))%2CFALSE%2CTRUE)%3C%2FP%3E%3CP%3E%3DIF(ISERROR(VLOOKUP(D196%2CCTO!A%3AA%2C1%2CFALSE))%2CFALSE%2CTRUE)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBoth%20work%20perfectly%20and%20return%20%22false%22%20for%20items%20not%20in%20the%20referenced%20lists.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20I%20want%20to%20do%20is%20put%20them%20together%20in%20a%20new%20IF%20statement%20that%20says%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20(cell%20reference)%3D%22Accessories%22%2C%20use%20stmt%201%2C%20otherwise%20use%20stmt%202.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20did%20this%20but%20it%20doesn't%20work%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIF(FT2%3D%22Accessories%22%2C(IF(ISERROR(VLOOKUP(D2%2C'SKU%20list'!J%3AJ%2C1%2CFALSE))%2CFALSE%2CTRUE)%2C(IF(ISERROR(VLOOKUP(D178%2CCTO!A%3AA%2C1%2CFALSE))%2CFALSE%2CTRUE))))%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20error%20says%20one%20of%20the%20values%20is%20the%20wrong%20data%20type.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20ideas%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-325108%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-325266%22%20slang%3D%22en-US%22%3ERe%3A%20using%20IF(ISERROR)%20statements%20with%20true%2Ffalse%20outcome%20in%20an%20IF%20statement%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-325266%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20are%20welcome%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-325222%22%20slang%3D%22en-US%22%3ERe%3A%20using%20IF(ISERROR)%20statements%20with%20true%2Ffalse%20outcome%20in%20an%20IF%20statement%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-325222%22%20slang%3D%22en-US%22%3E%3CP%3EYes!%20That's%20it!%20I%20had%20an%20extra%20set%20of%20parenthesis%20that%20changed%20the%20formula.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you!%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-325204%22%20slang%3D%22en-US%22%3ERe%3A%20using%20IF(ISERROR)%20statements%20with%20true%2Ffalse%20outcome%20in%20an%20IF%20statement%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-325204%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYour%20current%20formula%20is%3C%2FP%3E%0A%3CPRE%3E%3DIF(FT2%3D%22Accessories%22%2C%0A%20%20%20(%0A%20%20%20%20%20%20IF(ISERROR(VLOOKUP(D2%2C'SKU%20list'!J%3AJ%2C1%2CFALSE))%2CFALSE%2CTRUE)%2C%0A%20%20%20%20%20%20(IF(ISERROR(VLOOKUP(D178%2CCTO!A%3AA%2C1%2CFALSE))%2CFALSE%2CTRUE))%0A%20%20%20)%0A)%0A%3C%2FPRE%3E%0A%3CP%3EIf%20you%20update%20on%3C%2FP%3E%0A%3CPRE%3E%3DIF(FT2%3D%22Accessories%22%2C%0A%20%20%20IF(ISERROR(VLOOKUP(D2%2C'SKU%20list'!J%3AJ%2C1%2CFALSE))%2CFALSE%2CTRUE)%2C%0A%20%20%20IF(ISERROR(VLOOKUP(D178%2CCTO!A%3AA%2C1%2CFALSE))%2CFALSE%2CTRUE)%0A)%0A%3C%2FPRE%3E%0A%3CP%3Eperhaps%20it%20will%20work%2C%20I%20didn't%20test%3C%2FP%3E%3C%2FLINGO-BODY%3E
4ck3r360
New Contributor

Hello and Greetings,

 

I have two formulas:

 

=IF(ISERROR(VLOOKUP(D6,'SKU list'!J:J,1,FALSE)),FALSE,TRUE)

=IF(ISERROR(VLOOKUP(D196,CTO!A:A,1,FALSE)),FALSE,TRUE)

 

Both work perfectly and return "false" for items not in the referenced lists.

 

What I want to do is put them together in a new IF statement that says:

 

If (cell reference)="Accessories", use stmt 1, otherwise use stmt 2.

 

I did this but it doesn't work:

 

=IF(FT2="Accessories",(IF(ISERROR(VLOOKUP(D2,'SKU list'!J:J,1,FALSE)),FALSE,TRUE),(IF(ISERROR(VLOOKUP(D178,CTO!A:A,1,FALSE)),FALSE,TRUE))))

 

The error says one of the values is the wrong data type.

 

Any ideas?

 

Thanks!

3 Replies
Solution

Hi,

 

Your current formula is

=IF(FT2="Accessories",
   (
      IF(ISERROR(VLOOKUP(D2,'SKU list'!J:J,1,FALSE)),FALSE,TRUE),
      (IF(ISERROR(VLOOKUP(D178,CTO!A:A,1,FALSE)),FALSE,TRUE))
   )
)

If you update on

=IF(FT2="Accessories",
   IF(ISERROR(VLOOKUP(D2,'SKU list'!J:J,1,FALSE)),FALSE,TRUE),
   IF(ISERROR(VLOOKUP(D178,CTO!A:A,1,FALSE)),FALSE,TRUE)
)

perhaps it will work, I didn't test

Yes! That's it! I had an extra set of parenthesis that changed the formula.

 

Thank you! @Sergei Baklan

Related Conversations
More than 10 statements for Likert Scale feature
Amani24 in Microsoft Forms on
1 Replies
Help with an IF AND formula
aanaya6 in Excel on
3 Replies
IF FUNCTION ISN'T WORKING NO MATTER HOW SIMPLE THE COMMAND IS
thomasea in Excel on
6 Replies
Excel If Functions
Mfouad2255 in Excel on
10 Replies