Help with nested if statements with vlookups

tiltz

New Member
Joined
Apr 3, 2012
Messages
22
I am trying to have a multiple criteria if statement to vlookup a value based region (which each is on a different tab). Each of the if statements work fine on their own, but not combined. What am i doing wrong here:

=OR(IF(A2="USA",VLOOKUP(B:B,USA!A:B,2,FALSE),"NA"),IF(A2="CAN",VLOOKUP(Canada!A:B,2,FALSE),"NA"),IF(Tracker!A2="EMEA",VLOOKUP(EMEA!A:B,2,FALSE),"NA"),IF(Tracker!A2="LATAM",VLOOKUP(LATAM!A:B,2,FALSE),"NA"),IF(Tracker!A2="Non-integrated",VLOOKUP(Non-Integrated!A:B,2,FALSE),"NA"))
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi,

You started your formula with the OR function, which will give you either TRUE or FALSE as a result.

Try Nesting your IFs, replace the "Value if False" part of the 1st IF statement (where it says "NA") with the Next IF statement, and so on:
 
Upvote 0
Just tried this still giving me an error:

=IF(A2="USA",VLOOKUP(B:B,USA!A:B,2,FALSE),IF(A2="CAN",VLOOKUP(Canada!A:B,2,FALSE),IF(Tracker!A2="EMEA",VLOOKUP(EMEA!A:B,2,FALSE),IF(Tracker!A2="LATAM",VLOOKUP(LATAM!A:B,2,FALSE),IF(Tracker!A2="Non-integrated",VLOOKUP(Non-Integrated!A:B,2,FALSE),"NA"))
 
Upvote 0
Your VLOOKUP functions don't contain a value to lookup? It's not 100% clear what you're trying to do; the OR() at the start can't be right. So it's something like this:

If Tracker!A2 = "USA" then lookup {some value} in column A of sheet USA and return the value from column B. If the value doesn't exist then return "NA"
Similar conditions for CAN, EMEA, LATAM and Non-integrated

The question is, what is {some value} - is it in cell B2? Also, what happens if A2 is not one of these values? Pure guesswork here but what about:

Code:
=IFERROR(VLOOKUP(Tracker!$B2,INDIRECT(Tracker!$A2&"!$A:$B"),2,FALSE),"NA")

WBD
 
Last edited:
Upvote 0
Just tried this still giving me an error:

=IF(A2="USA",VLOOKUP(B:B,USA!A:B,2,FALSE),IF(A2="CAN",VLOOKUP(Canada!A:B,2,FALSE),IF(Tracker!A2="EMEA",VLOOKUP(EMEA!A:B,2,FALSE),IF(Tracker!A2="LATAM",VLOOKUP(LATAM!A:B,2,FALSE),IF(Tracker!A2="Non-integrated",VLOOKUP(Non-Integrated!A:B,2,FALSE),"NA"))

You're missing a few closing brackets ) for the IFs, it should look something like below, I can't test the formula as I don't want to create all those Sheets and dummy data, see if it works:


Excel 2010
C
1#REF!
Sheet30
Cell Formulas
RangeFormula
C1=IF(A2="USA",VLOOKUP(B:B,USA!A:B,2,FALSE),IF(A2="CAN",VLOOKUP(Canada!A:B,2,FALSE),IF(Tracker!A2="EMEA",VLOOKUP(EMEA!A:B,2,FALSE),IF(Tracker!A2="LATAM",VLOOKUP(LATAM!A:B,2,FALSE),IF(Tracker!A2="Non-integrated",VLOOKUP(Non-Integrated!A:B,2,FALSE),"NA")))))
 
Upvote 0
The formula is no longer erroring, but it's only pulling in the info from the USA tab:

USADENVER5/18/2018
USACRANSTONWeek of 5/7
USAATLANTATBD
USATAMPATBD
CANRichmond, BC#VALUE!
CANToronto ICD#VALUE!
CANMontreal ICD#VALUE!
EMEACadishead, UK#VALUE!
EMEAWidnes, UK#VALUE!
EMEABelgium#VALUE!
EMEAGenay, France#VALUE!
EMEAMorolo, IT#VALUE!
LATAMGuadalajara #VALUE!
LATAMRecife#VALUE!

<colgroup><col span="2"><col></colgroup><tbody>
</tbody>
 
Upvote 0
Did you try my formula?

Code:
=IFERROR(VLOOKUP(Tracker!$B2,INDIRECT(Tracker!$A2&"!$A:$B"),2,FALSE),"NA")

WBD
 
Upvote 0
My post #5 was ONLY to correct your brackets, it's Not meant to be a working formula as I stated.

I didn't even really look thru the formula, but as WBD pointed out, you're missing the LOOKUP values in your formula, so correct them as suggested by WBD.
 
Upvote 0
Ah. Shame they don't match. Try this then:

Code:
=IFERROR(VLOOKUP($B2,CHOOSE(MATCH($A2,{"USA","CAN","EMEA","LATAM","Non-integrated"},0),USA!$A:$B,CAN!$A:$B,EMEA!$A:$B,LATAM!$A:$B,'Non-Integrated'!$A:$B),2,FALSE),"NA")

WBD
 
Upvote 0

Forum statistics

Threads
1,215,635
Messages
6,125,946
Members
449,275
Latest member
jacob_mcbride

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