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
 

Some videos you may like

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
47,926
Office Version
  1. 365
Platform
  1. Windows
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)
 

dmadhup

Board Regular
Joined
Feb 21, 2018
Messages
146
Office Version
  1. 365
Thank you Peter and Marshl for quick response!
 

dmadhup

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

ADVERTISEMENT

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)
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
47,926
Office Version
  1. 365
Platform
  1. Windows
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)
 

dmadhup

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

ADVERTISEMENT

Thank you so much Peter.
Appreciated!
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
47,926
Office Version
  1. 365
Platform
  1. Windows
You're welcome. Glade we could help. :)
 

dmadhup

Board Regular
Joined
Feb 21, 2018
Messages
146
Office Version
  1. 365
Hi,
Is it possible to make it work for text data? For example below

1596775740791.png
1596775769158.png
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
47,926
Office Version
  1. 365
Platform
  1. Windows
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))
 

Watch MrExcel Video

Forum statistics

Threads
1,122,577
Messages
5,596,996
Members
414,116
Latest member
sfullnet

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
Top