VLOOKUP MULTIPLE COLUMNS

TUhl

New Member
Joined
Mar 29, 2007
Messages
24
With the knowlege that I have of Excel, VLOOKUP is the best function I know of to look up and match to other data in a workbook. If there is another way to do this please let me know.

I need to use 2 columns in a data array to match in order to be supplied with the correct item number that is also in the data array (in a different column). This is what I have tried:

=VLOOKUP(G2:H2,data array,1,false)

This is the part I am having trouble with

Help?!

Thank you

Toni
 
Copy of 9_625 2007.xls
ABCDEFG
1ITEM#CommonWellAFECommonWellNameDisctrictDescriptionTRansferDateItemSize(in)Grade
2WT8583CTR23-3-597PICEANCEHL2/17/20079.625J-55
3WT8583CTR23-3-597PICEANCEHL2/17/20079.625J-55
4WT8583CTR23-3-597PICEANCEHL3/7/20079.625J-55
5WT8583CTR23-3-597PICEANCEHL3/7/20079.625J-55
6WT8619CTR533-3-597PICEANCE3/8/20079.625J-55
7WT8619CTR533-3-597PICEANCE3/8/20079.625J-55
8WT8619CTR533-3-597PICEANCE3/9/20079.625J-55
9WT8619CTR533-3-597PICEANCE3/9/20079.625J-55
10WT8395FEDERALBCU23-22-198PICEANCEHL1/11/20079.625J-55
11WT8395FEDERALBCU23-22-198PICEANCEHL2/1/20079.625J-55
12WT8395FEDERALBCU23-22-198PICEANCEHL1/10/20079.625J-55
13WT2978FEDERALRGU12-10-298DPICEANCEHL1/31/20079.625J-55
14WT2978FEDERALRGU12-10-298DPICEANCEHL1/31/20079.625J-55
15WT2978FEDERALRGU12-10-298DPICEANCEHL2/1/20079.625H-40
16WT2978FEDERALRGU12-10-298DPICEANCEHL1/14/20079.625H-40
17WT2980FEDERALRGU14-28-198PICEANCE2/20/20079.625J-55
JAN-MAR


Ok, I need an Item # to appear in the A column when the Item size AND the Grade match the data array (I will post that in a second). If you look down Column F you will notice that the Item Size is all the same but the Grade is different in a few fields.
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Copy of 9_625 2007.xls
ABCD
1ITEMSIZEGRADEITEM#WEIGHT
21.9J-55083055.A2.75
32.375J-55083059.A4.7
42.375N-80083127.A4.7
54.5I-80083007.A11.6
64.5P-110083008.A11.6
74.5I-100083487.A11.6
89.625J-55083041.A36
99.625H-40083045.A32.3
109.625J-55083411.A40
ITEM #S


here is the data array
 
Upvote 0
Same idea as the previous formula I suggested:

A2=INDEX('Item #S'!C$2:C$10,MATCH(1,('Item #S'!A$2:A$10=F2)*('Item #S'!B$2:B$10=G2),0)), confirmed with CTRL+SHIFT+ENTER
 
Upvote 0
Thank you soooo much! It worked. If you don't mind will you explain what the formula is doing incase i have to do it again on another spreadsheet?
 
Upvote 0
It's really the same formula I suggested in my Scooby Doo example, just modified for your ranges/sheet names...

Have a look at the INDEX and MATCH formulas in Excel help to understand how those work.

Then, the only curveball is the ('Item #S'!A$2:A$10=F2)*('Item #S'!B$2:B$10=G2) part....Since Excel treats TRUE as 1 and FALSE as 0, this part will return an array of 1's and 0's according to whether each column A/column B combination in rows 2:10 meet both criteria (to receive a 1) or does not meet at least one criterion (to receive a 0).

Since ('Item #S'!A$2:A$10=F2)*('Item #S'!B$2:B$10=G2) returns an array (as opposed to a single value), you need the CTRL+SHIFT+ENTER confirmation.

Does that help?
 
Upvote 0
It does! Thank you so much...How would it change if I needed to look at 3 columns ie size, weight and grade?
 
Upvote 0

Forum statistics

Threads
1,223,757
Messages
6,174,330
Members
452,555
Latest member
colc007

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