VLOOKUP - Questions

Terrick

New Member
Joined
Jun 3, 2015
Messages
47
Hey guys,

I'm currently trying to create a "cheat sheet" for some Pricing.
Currently, "Sheet1" looks like this. I have each column represented for the Size/Style/Price/Date.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Size[/TD]
[TD]Style[/TD]
[TD]Price[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]24 x 42[/TD]
[TD]Harvey 2[/TD]
[TD]42.88[/TD]
[TD]4-12-19[/TD]
[/TR]
[TR]
[TD]30 x 42[/TD]
[TD]Harvey 2[/TD]
[TD]45.05[/TD]
[TD]4-12-19[/TD]
[/TR]
[TR]
[TD]42 x 42[/TD]
[TD]Harvey 2[/TD]
[TD]52.58[/TD]
[TD]4-12-19[/TD]
[/TR]
[TR]
[TD]24 x 42[/TD]
[TD]Harvey 2[/TD]
[TD]43.08[/TD]
[TD]6-27-19[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
My questions is, can I get my "Sheet2" VLOOKUP to return multiple pricing and dates? I currently have it setup to only return 1 Item. But as you can see in the above table, I have ( 2 ) 24 x 42 with different pricing and different dates.
Is it possible to have VLOOKUP return each of those items without repeating and putting the most current date at the top then descend?
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Size[/TD]
[TD]Style[/TD]
[TD]Price[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]24 x 42[/TD]
[TD]Harvey 2[/TD]
[TD]42.88[/TD]
[TD]4-12-19[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

EDIT:
This is the code I'm using to find each value, but need to return multiple.
Code:
=VLOOKUP(A2,Sheet1!A2:D22,2,FALSE)
Hopefully I explained this well enough for someone to help.
Thanks,
Terrick
 
Last edited:
Hi

1. Never use VLOOKUP - Always use INDEX and MATCH instead

2. You should use a range names for your table since if you change the sheet name and/or move the table, the macro will not work anymore

3. What you can do is a loop through the table and then check each entry to see if it matches and then store
 
Last edited:
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Without a range name at present, in A9 put one of the styles (e.g., Harvey 2).
Then, change B9 in my original to:

Code:
=IFERROR(INDEX(B$1:B$5,SMALL(IF(($C$1:$C$5=$A$9)*($B$1:$B$5=$A$8),ROW($B$1:$B$5)),ROW(1:1))),"")

NOTE: still an array formula.

Then, fill across and down.

[TABLE="width: 386"]
<colgroup><col span="4"><col></colgroup><tbody>[TR]
[TD][/TD]
[TD]Size[/TD]
[TD]Style[/TD]
[TD]Price[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]24 x 42[/TD]
[TD]Harvey 2[/TD]
[TD="align: right"]42.88[/TD]
[TD="align: right"]4/12/2019[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]24 x 42[/TD]
[TD]Harvey 3[/TD]
[TD="align: right"]45.05[/TD]
[TD="align: right"]4/12/2019[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]42 x 42[/TD]
[TD]Harvey 2[/TD]
[TD="align: right"]52.58[/TD]
[TD="align: right"]4/12/2019[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]24 x 42[/TD]
[TD]Harvey 2[/TD]
[TD="align: right"]43.08[/TD]
[TD="align: right"]6/27/2019[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]24 x 42[/TD]
[TD]Size[/TD]
[TD]Style[/TD]
[TD]Price[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]Harvey 2[/TD]
[TD]24 x 42[/TD]
[TD]Harvey 2[/TD]
[TD="align: right"]42.88[/TD]
[TD="align: right"]4/12/2019[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]24 x 42[/TD]
[TD]Harvey 2[/TD]
[TD="align: right"]43.08[/TD]
[TD="align: right"]6/27/2019[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,320
Members
452,635
Latest member
laura12345

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