Multiple vlookups for different tables

Waimea

Active Member
Joined
Jun 30, 2018
Messages
465
Office Version
  1. 365
Platform
  1. Windows
Hi, I am trying to use several tables in an if formula but I haven't gotten it to work.

I have one master table which I want to look up to first, however, if the lookup value contains City (Suburb), City2(Suburb) or City3 (Suburb) I want to look up from three different lookups tables.

I have 4 Tables in total, master, table1, table2, table3.

Can anyone help me with this?

Thank you in advance!
 
Re: How to use multiple vlookups for different tables

Hi Aladin,

thank you for your reply.

I don't understand what isn't clear?


I already made some suggestions in post #8 .


I want to lookup 320 values, some of the values have "(suburbs)" in them, I want to use another lookup table based on the presence of "(suburb)".

Care to post two real look up values: one without suburb and one with suburb?
 
Upvote 0

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Re: How to use multiple vlookups for different tables

Thank you for your reply.

"City" is a named range for Cell B2, which in turn is connected to an ActiveX ComboBox linked cell.

I am trying to use multiple VLOOKUPS using IFERROR but it doesn't work.

Code:
=IFERROR(VLOOKUP(City;Data[#All];MATCH($D89&" "&F$88;Data[#Headers];0);FALSE);IFERROR(VLOOKUP(City;Data2[#All];MATCH($D89&" "&F$88;Data2[#Headers];0);FALSE);IFERROR(VLOOKUP(City;Data3[#All];MATCH($D89&" "&F88;Data3[#Headers]!;0);FALSE);"")))

The VLOOKUP are the same for suburb and without suburb.

But I guess they would be:

Code:
=IFERROR(VLOOKUP(City;Data[#All];MATCH(F$88&" "&$D90;Data[#Headers];0);FALSE);"")

Code:
=IFERROR(VLOOKUP(City2 (subrub);Data2[#All];MATCH(F$88&" "&$D90;Data2[#Headers];0);FALSE);"")

Code:
=IFERROR(VLOOKUP(City3 (subrub);Data3[#All];MATCH(F$88&" "&$D90;Data3[#Headers];0);FALSE);"")

Code:
=IFERROR(VLOOKUP(City4 (subrub);Data4[#All];MATCH(F$88&" "&$D90;Data4[#Headers];0);FALSE);"")

Perhaps I could use multiple IF statements?

Code:
=IF(City="* (suburb);VLOOKUP1, VLOOKUP2 ?
 
Upvote 0
Re: How to use multiple vlookups for different tables

Hi Aladin,

I don't understand what you want to see? These are the lookup values that I am using.

I have already shown the values that I lookup as you suggested in post 8#.

Code:
[B]Name       Population       [/B]
City          50 000
City2        60 000
City3        40 000


Code:
[B]Name       Population       [/B]
City3 (Suburb 1)  20 000
City3 (Suburb 2)  20 000
 
Upvote 0
Re: How to use multiple vlookups for different tables

You seem to like abstractions... To my knowledge, there is no city which is called City3 in the world or anything like City3 (Suburb 1). Just because you think real names are irrelevant for the solution you have in mind, you still don't provide real look up values. That said, another abstract solution (my 3rd now)...

IFERROR(LOOKUP(REPT("z",255),CHOOSE({1,2},VLOOKUP(X2,TABLE,2,0),VLOOKUP(X2&"*",TABLE,2,0))),"not found")

where TABLE is a 2-column range which contains cities and/or city-suburb pairs along with the population numbers. X2 houses a city or a city/suburb pair.
 
Upvote 0
Re: How to use multiple vlookups for different tables

Hi Aladin,

I got it to work with your last suggestion, thank you very much for your time!
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

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