Formula to find the in-between number in a range

Nathan Asius

New Member
Joined
Jan 15, 2024
Messages
41
Office Version
  1. 365
Platform
  1. Windows
I have built a spreadsheet to calculate custom orders. On my dashboard I have a cell which I named "Cost". This cell is a sum of the cost of all products elsewhere on the sheet.
I need to calculate the markup based on what the cost total comes to in this named cell.
On another worksheet I have this small table which lists the range of amounts and the percentage of the markup related to the total. So, for example, you can see on in the attached range of data, if the total cost comes to $1350.00 then a 10% markup applies. The first figure I could use a formula with and Equal To/Less than operator. And the last Figure I could simply use an Equal To/Greater Than operator. What is stumping me is the formulas for the middle two figures, to get in-between the minimum and maximums.
I have attempted two different formulas to calculate the right markup. Neither of them worked. I attached the formulas I used. Is it due to the Excel version I'm using that caused me to miss something?

Seems like it should be easier to solve this.
Formula.png
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Give this a try:
Book2
ABACADAE
1
2
31350
4
5Min $ AmtMax $ AmtMarkup
6$ -$ 250.0020%135
7$ 251.00$ 1,000.0015%
8$ 1,001.00$ 5,000.0010%
9$ 5,001.00$ 5,000,000.008%
Sheet1
Cell Formulas
RangeFormula
AE6AE6=$AE$3*LOOKUP($AE$3,$AB$6:$AB$9,$AD$6:$AD$9)


$AE$3 would be your "Cost" cell. And you will have to add your sheet name in the references if the formula is going to be on a different sheet from either the Cost cell or the lookup table.
 
Upvote 0
Solution
Try
Excel Formula:
=if(cost=median(cost,ab6:ac6),cost*ad6,"no")
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,175
Members
452,615
Latest member
bogeys2birdies

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