If Statement tiered bucket help

PghYoPro

New Member
Joined
Dec 9, 2015
Messages
23
Hello,

I have the following data:

UnitsMinMaxPrice per Unit
91307063760040
7601800045
8001920050
920155

<tbody>
</tbody>

The total price paid would be the overage in each bucket * the price per unit. How can I write this using a single IF statement?

Thanks
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
What if it is less than the minimum number you have shown (7063)?
 
Upvote 0
Hi Joe, if the number of units is less than 7063 the price per unit would be $0. The solution in this problem would be $95,970. Not sure if that was clear
 
Last edited:
Upvote 0
The solution in this problem would be $95,970.
I don't see how you arrive at that number.
Can you break it down for us?
 
Upvote 0
I am assuming the Units title is in cell A1
Code:
<b3),d2,if(and(a2><b4),d3,if(and(a2><b5),d4,if(a2>=IF(AND(A2 > =B2,A2<b3),d2,if(and(a2> =B3,A2 < B4),D3,IF(AND(A2 > =B4,A2 < B5),D4,IF(A2 > =B5,D5,"Units are below valid minimum"))))
This returns the price per unit.

I was unsure what you meant by overage (whether you meant just the final difference is to be calculated or a cumulative difference of the respective prices). So you'll need to put the calculation that you want it to do around the 4 places that column D is referenced.</b3),d2,if(and(a2></b5),d4,if(a2></b4),d3,if(and(a2></b3),d2,if(and(a2>
 
Last edited:
Upvote 0
No problem, I'm getting $95,940 by taking the amount in each bucket * the value then adding the totals for each bucket to reach the grand total.

7064-7600: 536 units * $40 = $21,440
7600-8000: 400 units * $45 = $18,000
8000-9201: 1,130 units * $50 = $56,500
 
Upvote 0
I get 95980, because 7064 - 7600 is actually 537 units, not 536 (think of it this way, is 7064 - 7064 one unit or none)?
So, if you MIN/MAX/PRICE grid was in cells A1:C6 (where row 1 is the header row), and your number is in cell E2, this formula returns what you are looking for:
Code:
=(MAX(MIN(B3-A3+1,$E$2-A3+1),0)*C3)
+(MAX(MIN(B4-A4+1,$E$2-A4+1),0)*C4)
+(MAX(MIN(B5-A5+1,$E$2-A5+1),0)*C5)
+(IF(E2>=A6,$E$2-A6+1,0)*C6)
 
Upvote 0
Another option:

ABCDE
1UnitsMinMaxPrice per UnitRelative change
29130706376004040
376018000455
4Total Price80019200505
5959709201555

<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2

Worksheet Formulas
CellFormula
A5=SUMPRODUCT(A2-B2:B5,E2:E5,--(A2>B2:B5))
E3=D3-D2
E4=D4-D3
E5=D5-D4

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,328
Messages
6,124,299
Members
449,149
Latest member
mwdbActuary

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