IF(ISERROR with multiple if conditions or combine two IF(ISERROR

AlineCastiVitkov

New Member
Joined
Jan 11, 2023
Messages
4
Office Version
  1. 365
Platform
  1. Windows
How can I combine the formulas into ONE? I'm having a hard time the order in which they should be, I either get the "missing parenthesis error" or the "too few arguments" screen.
=IF(ISERROR(FIND("X",Q11)), VLOOKUP(H11,$AE$1:$AH$6,2,FALSE),"")
=IF(ISERROR(FIND("HON",B11)), VLOOKUP(H11,$AE$1:$AH$6,3,FALSE),VLOOKUP(H11,$AE$1:$AH$6,4,FALSE))
I need to incorporate the condicton IF(FIND("AP",B11)), in order for VLOOKUP(H11,$AE$1:$AH$6,4,FALSE)

Thank you
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
FIND is case sensitive
=ISNUMBER(SEARCH("x",Q11))

BUT
IF(FIND("AP",B11)), in order for VLOOKUP(H11,$AE$1:$AH$6,4,FALSE)
Needs the ISERROR
IF(ISERROR(FIND("AP",B11)), in order for VLOOKUP(H11,$AE$1:$AH$6,4,FALSE)

=IF(ISERROR(FIND("X",Q11)),VLOOKUP(H11,$AE$1:$AH$6,2,FALSE),IF(ISERROR(FIND("HON",B11)),VLOOKUP(H11,$AE$1:$AH$6,3,FALSE),IF(ISERROR(FIND("AP",B11)),VLOOKUP(H11,$AE$1:$AH$6,4,FALSE),"")))
Excel Formula:
=IF(ISERROR(FIND("X",Q11)), VLOOKUP(H11,$AE$1:$AH$6,2,FALSE),  IF(ISERROR(FIND("HON",B11)), VLOOKUP(H11,$AE$1:$AH$6,3,FALSE),IF(ISERROR(FIND("AP",B11)),VLOOKUP(H11,$AE$1:$AH$6,4,FALSE),"")))

you may want to wrap in an IFERROR if the vlookup's are not found to avoid an N/A error

Excel Formula:
IFERROR  (  IF(ISERROR(FIND("X",Q11)), VLOOKUP(H11,$AE$1:$AH$6,2,FALSE),  IF(ISERROR(FIND("HON",B11)), VLOOKUP(H11,$AE$1:$AH$6,3,FALSE),IF(ISERROR(FIND("AP",B11)),VLOOKUP(H11,$AE$1:$AH$6,4,FALSE),""))),"")
 
Upvote 0
FIND is case sensitive
=ISNUMBER(SEARCH("x",Q11))

BUT

Needs the ISERROR
IF(ISERROR(FIND("AP",B11)), in order for VLOOKUP(H11,$AE$1:$AH$6,4,FALSE)

=IF(ISERROR(FIND("X",Q11)),VLOOKUP(H11,$AE$1:$AH$6,2,FALSE),IF(ISERROR(FIND("HON",B11)),VLOOKUP(H11,$AE$1:$AH$6,3,FALSE),IF(ISERROR(FIND("AP",B11)),VLOOKUP(H11,$AE$1:$AH$6,4,FALSE),"")))
Excel Formula:
=IF(ISERROR(FIND("X",Q11)), VLOOKUP(H11,$AE$1:$AH$6,2,FALSE),  IF(ISERROR(FIND("HON",B11)), VLOOKUP(H11,$AE$1:$AH$6,3,FALSE),IF(ISERROR(FIND("AP",B11)),VLOOKUP(H11,$AE$1:$AH$6,4,FALSE),"")))

you may want to wrap in an IFERROR if the vlookup's are not found to avoid an N/A error

Excel Formula:
IFERROR  (  IF(ISERROR(FIND("X",Q11)), VLOOKUP(H11,$AE$1:$AH$6,2,FALSE),  IF(ISERROR(FIND("HON",B11)), VLOOKUP(H11,$AE$1:$AH$6,3,FALSE),IF(ISERROR(FIND("AP",B11)),VLOOKUP(H11,$AE$1:$AH$6,4,FALSE),""))),"")

FIND is case sensitive
=ISNUMBER(SEARCH("x",Q11))

BUT

Needs the ISERROR
IF(ISERROR(FIND("AP",B11)), in order for VLOOKUP(H11,$AE$1:$AH$6,4,FALSE)

=IF(ISERROR(FIND("X",Q11)),VLOOKUP(H11,$AE$1:$AH$6,2,FALSE),IF(ISERROR(FIND("HON",B11)),VLOOKUP(H11,$AE$1:$AH$6,3,FALSE),IF(ISERROR(FIND("AP",B11)),VLOOKUP(H11,$AE$1:$AH$6,4,FALSE),"")))
Excel Formula:
=IF(ISERROR(FIND("X",Q11)), VLOOKUP(H11,$AE$1:$AH$6,2,FALSE),  IF(ISERROR(FIND("HON",B11)), VLOOKUP(H11,$AE$1:$AH$6,3,FALSE),IF(ISERROR(FIND("AP",B11)),VLOOKUP(H11,$AE$1:$AH$6,4,FALSE),"")))

you may want to wrap in an IFERROR if the vlookup's are not found to avoid an N/A error

Excel Formula:
IFERROR  (  IF(ISERROR(FIND("X",Q11)), VLOOKUP(H11,$AE$1:$AH$6,2,FALSE),  IF(ISERROR(FIND("HON",B11)), VLOOKUP(H11,$AE$1:$AH$6,3,FALSE),IF(ISERROR(FIND("AP",B11)),VLOOKUP(H11,$AE$1:$AH$6,4,FALSE),""))),"")
Hello, thank you for the suggestions, although I get no errors:), the formula is not working properly as when there is an "X" in cell Q11 the result should be an empty cell, instead, it is giving the result of the condition of looking in table (AE1:AH6) when cell B11 contains "AP".
 
Upvote 0
Your use of Find implies you don't want ="X" but contains "X" etc. Let us know if that is not the case.

I suspect your logic is back to front.
Assuming your want
Test X then column 2
if not then test HON then column 3
if not then test AP then column 4
otherwise ""

Then this should work for you.
Excel Formula:
=IF(COUNTIFS(Q11, "*X*"),
         VLOOKUP(H11, $AE$1:$AH$6, 2, FALSE),
         IF(COUNTIFS(B11, "*HON*"),
                VLOOKUP(H11, $AE$1:$AH$6, 3, FALSE),
               IF(COUNTIFS(B11, "*AP*"),
                      VLOOKUP(H11, $AE$1:$AH$6, 4, FALSE),
                      "")))
 
Upvote 0
we have 3 lookups
IFERROR ( IF(ISERROR(FIND("X",Q11)), VLOOKUP(H11,$AE$1:$AH$6,2,FALSE), IF(ISERROR(FIND("HON",B11)), VLOOKUP(H11,$AE$1:$AH$6,3,FALSE),IF(ISERROR(FIND("AP",B11)),VLOOKUP(H11,$AE$1:$AH$6,4,FALSE),""))),"")
Q11, and 2 for B11
so as B11 cannot be AP and HON at the same time - then its going to return a TRUE and do a lookup
and if value not found return an N/A

you could add an additional IF
=AND(ISERROR(FIND("X",Q11)),ISERROR(FIND("HON",B11)),ISERROR(FIND("AP",B11)))
which will return "" if cells do NOT contain X, AP or HON

=IF(AND(ISERROR(FIND("X",Q11)),ISERROR(FIND("HON",B11)),ISERROR(FIND("AP",B11))), "",
=IF(ISERROR(FIND("X",Q11)), VLOOKUP(H11,$AE$1:$AH$6,2,FALSE), IF(ISERROR(FIND("HON",B11)), VLOOKUP(H11,$AE$1:$AH$6,3,FALSE),IF(ISERROR(FIND("AP",B11)),VLOOKUP(H11,$AE$1:$AH$6,4,FALSE),""))))
 
Upvote 0
To clarify, the logic needed is:
If “X” is found in Q11, then cell = Empty
If “X” is not found then, analyze for “HON” in cell B11, If “HON” is found then look for value of H11 in 3rd column of table AE1::AH6.
If “HON” is not found then, analyze for “AP” in cell B11, If “AP” is found then look for value of H11 in 4th column of table AE1::AH6.
If “AP” is not found then look for value of H11 in 2nd column of table AE1::AH6.
If error then cell = empty.

Thank You all for your help
 
Upvote 0
Try
Excel Formula:
=IF(COUNTIFS(Q11, "*X*"),
         "",
         IF(COUNTIFS(B11, "*HON*"),
                VLOOKUP(H11, $AE$1:$AH$6, 3, FALSE),
               IF(COUNTIFS(B11, "*AP*"),
                      VLOOKUP(H11, $AE$1:$AH$6, 4, FALSE),
                    VLOOKUP(H11, $AE$1:$AH$6, 2, FALSE)  )))
 
Upvote 0
Try
Excel Formula:
=IF(COUNTIFS(Q11, "*X*"),
         "",
         IF(COUNTIFS(B11, "*HON*"),
                VLOOKUP(H11, $AE$1:$AH$6, 3, FALSE),
               IF(COUNTIFS(B11, "*AP*"),
                      VLOOKUP(H11, $AE$1:$AH$6, 4, FALSE),
                    VLOOKUP(H11, $AE$1:$AH$6, 2, FALSE)  )))
Thank You for the code above, it worked. :)
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,824
Members
449,050
Latest member
Bradel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top