Vlookup value based on a range of quantities formula

mgiesige

New Member
Joined
May 25, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I'm trying to figure out a formula to return a price per item for specific items based on quantities specific to each of them. I can have one table with everything or I can do three separate tables; whichever is best. I've attached a sample using the single table.
For Example: Each item's price is based on a range. Item B will be a total price of $100 for a quantity of 1 through 36. So, buying 2 pieces of Item B will cost you $50 each or buying 36 pieces of Item B will cost you $2.78 each. Either way the total price is $100. Now, moving to 36 pieces and up to 72 pieces, the total cost would be $125. At 73 pieces, then someone needs to take a closer look, so I'd want it to return the text, "Get a quote."
I'm not sure how to write a formula for all of that. Ideas?

Sample vlookup and range.xlsx
ABCDEFGHI
1Item Quantity Total Price Item Quantity Price Each
2A57$ 105.00B70
3A114$ 140.001.79
4A115 Get a Quote 125/70=$1.79
5B36$ 100.00
6B72$ 125.00
7B73 Get a Quote
8C26$ 95.00
9C52$ 115.00
10C53 Get a Quote
11D34$ 100.00
12D68$ 120.00
13D69 Get a Quote
14
Sheet1
Cell Formulas
RangeFormula
I3I3=C6/H2
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Try that :). Change any 13s in formula to however many rows you need.

=IFERROR(INDEX(SORT(FILTER($C$2:$C$13,$A$2:$A$13=G2,),,-1),MATCH(H2,SORT(FILTER($B$2:$B$13,$A$2:$A$13=G2,),,-1),-1))/H2,"Get a Quote")

Thanks.

Book3
ABCDEFGHI
1ItemQuantityTotal PriceItemQuantityPrice Each
2A57105B70$ 1.79
3A114140
4A115Get a Quote
5B36100
6B72125
7B73Get a Quote
8C2695
9C52115
10C53Get a Quote
11D34100
12D68120
13D69Get a Quote
Sheet1
Cell Formulas
RangeFormula
I2I2=IFERROR(INDEX(SORT(FILTER($C$2:$C$13,$A$2:$A$13=G2,),,-1),MATCH(H2,SORT(FILTER($B$2:$B$13,$A$2:$A$13=G2,),,-1),-1))/H2,"Get a Quote")
 
Upvote 0
Solution
dalvin647, that is an incredible formula! I can follow it and it works in my real spreadsheet. Thanks. Now, I'll go learn about sorts and filters in the index/match function. Thank you!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,180
Members
453,021
Latest member
Justyna P

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