How to do vlookup on table where value is instrumental? See details.

dmadhup

Board Regular
Joined
Feb 21, 2018
Messages
146
Office Version
  1. 365
Hi,

I want to do VLOOKUP on sheet1 to Sheet2 and get Price. But I want to see the result as show in sheet1. Saying that, VLOOKUP will pick the data where there is incremental.
This formula doesn't meet my requirements.
=VLOOKUP(A3,Sheet2!A:B,2,FALSE)

Any idea to achieve the goal?


1596771357070.png
1596771383488.png
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Also suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with.

If your prices always increase with level like your samples, then if your version does not have MAXIFS, you could use this alternative which works in more versions.

dmadhup 2020-08-07 1.xlsm
AB
1
205
3130
4280
53100
Sheet1
Cell Formulas
RangeFormula
B2:B5B2=AGGREGATE(14,6,Sheet2!B$2:B$200/(Sheet2!A$2:A$200=A2),1)
 
Upvote 0
Peter,
Thank you for suggestion regarding excel version and Xl2BB. Excellent I enabled that option and I am using Office 365

In your formula, what is the meaning of 14,6 inside AGGREGATE?

=AGGREGATE(14,6,Sheet2!B$2:B$200/(Sheet2!A$2:A$200=A2),1)
 
Upvote 0
Thanks for updating your profile.

14 = Maximum
6 = Ignore errors

See here for more detail and examples

However, since you have Excel 365 you can use the MAXIFS suggestion by mrshl9898, though I generally try to avoid whole column references so would opt for a restricted range.
Something like =MAXIFS(Sheet2!B$1:B$200,Sheet2!A$1:A$200,A2)
 
Upvote 0
You're welcome. Glade we could help. :)
 
Upvote 0
Hi,
Is it possible to make it work for text data? For example below

1596775740791.png
1596775769158.png
 
Upvote 0
Don't forget this ;)
investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with.

Adjust ranges to suit & try
=LOOKUP(REPT("Z",255),FILTER(Sheet2!B$2:B$20,Sheet2!A$2:A$20=A2))
 
Upvote 0

Forum statistics

Threads
1,213,535
Messages
6,114,198
Members
448,554
Latest member
Gleisner2

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