mina91709

New Member
Joined
Mar 25, 2017
Messages
25
I AM TRYING TO USE VLOOKuP FEATURE TO LOOKUP TWO DIFFERENT CELLS AND PULL OUT VALUE FROM TWO DIFFERENT TABLE. SORRY IF MY EXPLANATION IS NOT CLEAR BUT HERE IS WHAT I AM TRYING TO Do

LOOK UP TABLES:

CITYTAX RATECOUNTYTAX RATE
A9%LA9.25%
B9.5%SA8.5%
C9%SB7.25%
D10%OC8.5%
E10.5&SL8%

<tbody>
</tbody>

CELLS TO MATCH AND MATCH INPUT FROM THE LOOK UP TABLES:
CITYA
COUNTYLA
TAX RATERETURN VALUE SHOULD BE THE VALUE OF THE CITY WHICH IS %9 AND IGNORE THE COUNTY

<tbody>
</tbody>

CITYF
COUNTYLA
TAX RATERETURN VALUE SHOULD BE THE COUNTY BECAUSE THE CITY IS NOT LISTED. VALUE WILL BE %9.25

<tbody>
</tbody>


THANK YOU VERY MUCH
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Looks like this works:

=IF(ISERROR(VLOOKUP(F1,A1:B5,2,FALSE))=TRUE,VLOOKUP(F1,C1:D5,2,FALSE),VLOOKUP(F1,A1:B5,2,FALSE))

Alter it to your correct cells and ranges of course.
 
Last edited:
Upvote 0
With your tax table in columns A to D "city to look for" in H1, and county to look for in H2

Find city tax rate formula =VLOOKUP($H$1,$A$2:$B$20,2,FALSE)
find county tax rate formula =VLOOKUP($H$2,$C$2:$D$20,2,FALSE) (always returns county rate, even if city match exists)

single formula =IFERROR(VLOOKUP($H$1,$A$2:$B$20,2,FALSE),VLOOKUP($H$2,$C$2:$D$20,2,FALSE)) looks for city level match .. if that fails look for county level match

all formulas based on city-county data in rows 2 to 20 . adjust if needed

CITYTAX RATECOUNTYTAX RATEcityF#N/A
A9%LA9.25%COUNTYLA9.25%
B9.50%SA8.50%
C9%SB7.25%OVERALL9.25%
D10%OC8.50%
E10.5&SL8%

<colgroup><col span="4"><col span="3"><col><col></colgroup><tbody>
</tbody>
 
Upvote 0
With your tax table in columns A to D "city to look for" in H1, and county to look for in H2

Find city tax rate formula =VLOOKUP($H$1,$A$2:$B$20,2,FALSE)
find county tax rate formula =VLOOKUP($H$2,$C$2:$D$20,2,FALSE) (always returns county rate, even if city match exists)

single formula =IFERROR(VLOOKUP($H$1,$A$2:$B$20,2,FALSE),VLOOKUP($H$2,$C$2:$D$20,2,FALSE)) looks for city level match .. if that fails look for county level match

all formulas based on city-county data in rows 2 to 20 . adjust if needed

CITYTAX RATECOUNTYTAX RATEcityF#N/A
A9%LA9.25%COUNTYLA9.25%
B9.50%SA8.50%
C9%SB7.25%OVERALL9.25%
D10%OC8.50%
E10.5&SL8%

<tbody>
</tbody>
thank you works well much appreciated
 
Upvote 0
With your tax table in columns A to D "city to look for" in H1, and county to look for in H2

Find city tax rate formula =VLOOKUP($H$1,$A$2:$B$20,2,FALSE)
find county tax rate formula =VLOOKUP($H$2,$C$2:$D$20,2,FALSE) (always returns county rate, even if city match exists)

single formula =IFERROR(VLOOKUP($H$1,$A$2:$B$20,2,FALSE),VLOOKUP($H$2,$C$2:$D$20,2,FALSE)) looks for city level match .. if that fails look for county level match

all formulas based on city-county data in rows 2 to 20 . adjust if needed

CITY
TAX RATE
COUNTY
TAX RATE
city
F
#N/A
A
9%
LA
9.25%
COUNTY
LA
9.25%
B
9.50%
SA
8.50%
C
9%
SB
7.25%
OVERALL
9.25%
D
10%
OC
8.50%
E
10.5&
SL
8%

<tbody>
</tbody>

Nice, I forgot about IFERROR(); your solution is more elegant. :)
 
Upvote 0
Nice, I forgot about IFERROR(); your solution is more elegant. :)

THANK YOU BOTH FOR YOUR HELP
I GOT ANOTHER CHALLENGE WITH VLOOK UP OR ANOTHER FORMULA THAT WOULD WORK AND WAS HOPING YOU CAN HELP ME WITH,

FORMULA WILL LOOK UP THE DATE FROM MULTIPLE TABLES AND POPULATE 1ST AND 2ND VALUES FOR THE CATEGORiES BASED THE DATE VALIDATION NOTE IT WILL GO TO THE NEXT VALID DATE SEE EXAMPLE BELOW

CATEGORY1ST VALUE2ND VALUEDATE INPUT
A10107/15/2008
B20207/15/2008
C30307/15/2008
D40407/15/2008
E50507/15/2008

<tbody>
</tbody>

GIVEN TABLES/LOOKUP TABLE
CATEGORY 1ST VALUE2ND VALUEVALID TO DATE 1ST VALUE2ND VALUEVALID TO DATE 1ST VALUE2ND VALUEDATE
A15206/30/2008101012/31/200830806/30/2009
B6056/30/2008202012/31/2008100506/30/2009
C586/30/2008303012/31/2008120806/30/2009
D796/30/2008404012/31/2008501006/30/2009
E20086/30/2008505012/31/2008100506/30/2009

<tbody>
</tbody>
 
Upvote 0
Okay, this will actually require a MATCH() / INDEX() solution. Because the date is to the right of the 1ST & 2ND VALUE Columns. And VLOOKUP() only works if the lookup value is in the furthest column to the left of what you are looking at. And for that reason, the rules of this forum require you to make a new thread. (pretty sure anyway).

Plus, you will get a wider variety of help with a new post. :) Enjoy your day. And if you don't get a reply on your new post, you can always private message either of us to take a look.
 
Upvote 0

Forum statistics

Threads
1,214,587
Messages
6,120,405
Members
448,958
Latest member
Hat4Life

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