Vlookup and Multiple Ranges

mucah!t

Well-known Member
Joined
Jun 27, 2009
Messages
593
Hi all

Does any of you know of a formula for column "K" that finds the corresponding amount from the ranges A:b, D:E or G:H?
Excel Workbook
ABCDEFGHIJK
1test1test2test3
2fec -75,00vgrythggw -135,00fec -75,00
3nhyn -41,00gty -400,00hjytrjrnhyn -41,00
4cfgbth -12,34hytgrf -150,00yhjicfgbth -12,34
5hytryjnhyt -54,99frtghytryjnhyt -54,99
6rvf -89,00rdetgrvf -89,00
7rw -559,07huygtrw -559,07
8thy -30,00ui7juthy -30,00
9btrer -12,83btrer -12,83
10bnnj -29,50bnnj -29,50
11uygvrw -56,00uygvrw -56,00
12vgr
13gty -400,00
14hytgrf -150,00
15frtg
16rdetg
17huygt
18ui7ju
19ythggw -135,00
20hjytrjr
21yhji
Sheet1
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
If there is no risk of duplicate entries in the A:H range, and you don't have a massive amount of data to work with

=INDIRECT(ADDRESS(SUMPRODUCT(($A$2:$H$11=J3)*ROW($A$2:$H$11)),SUMPRODUCT(($A$2:$H$11=J3)*COLUMN($A$2:$H$11))+1))

Otherwise it would be something on the lines of

=IF(ISNA(VLOOKUP(J2,$A$2:$B$11,2,0)),IF(ISNA(VLOOKUP(J2,$D$2:$E$11,2,0)),IF(ISNA(VLOOKUP(J2,$G$2:$H$11,2,0)),0,VLOOKUP( J2,$G$2:$H$11,2,0)),VLOOKUP(J2,$D$2:$E$11,2,0)),VLOOKUP(J2,$A$2:$B$11,2,0))

Or (excel 07 or later)

=IFERROR(VLOOKUP(J2,$A$2:$B$11,2,0),IFERROR(VLOOKUP(J2,$D$2:$E$11,2,0),IFERROR(VLOOKUP(J2,$G$2:$H$11,2,0),0)))
 
Last edited:
Upvote 0
Hi macah!t

Try this. For simplicity, assume your ranges are a2:b4,d2:e4,and g2:h4 respectively. Assume your results range begins at j2:k2 (goes downward). J2 is the lookup value, K2 is your where your formula to be copied down

in K2 =lookup(99^99,choose({1,2,3},vlookup(j2,a2:b4,2,false),vlookup(j2,d2:e4,2,false),vlookup(j2,g2:h4,2,false))). If you are solving for text entries, use =rept("z",255)..... instead of 99^99. Use $ to lock your ranges to absolute values.Copy down

Or in K2 =lookup(99^99,choose({1,2,3},index(b2:b4,match(j2,a2:a4,0)),index(e2:e4,match(j2,d2:d4,0)),index(h2:h4,match(j2,g2:g4,0)))). Lock in your index ranges and lookup ranges. Copy down
HTH,
Mike Szczesny
 
Upvote 0
Try...

K2, just enter and copy down:

=LOOKUP(9.99999999999999E+307,
CHOOSE({1,2,3,4},
0,
VLOOKUP(J2,$A$2:$B$11,2,0),
VLOOKUP(J2,$D$2:$E$8,2,0),
VLOOKUP(J2,$G$2:$H$4,2,0)))
[/code]

Note 1. On European systems, replace the decimal dot in the big number with comma and use semi-colon between terms instead of comma.

Note 2. Custom format the result range in column K as [=0]"";General.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,394
Members
448,957
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