Calculating total units where rates vary

VBremner

New Member
Joined
Nov 21, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I am trying to find a formula that will calculate the total value of a number of units, where there are different band rates that all need to be applied.

For example, I need to find the total of 385002 units.
50000 of the units are charged at £1 per unit, The next 49999 are charged at £0.9 per unit and so on. That would leave 10002 units to be charged in the lowest band.
Everything in black below is what I need on the spreadsheet, the red is just me showing the example of how it needs to calculate. I would like the outcome in cell G under total.

I have tried playing with varied iterations of "IF" and "Sumproduct" but I can't get anything to work when it gets over 1000001 units.

Any advice is appreciated, thanks

1700575420993.png
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
I have not worked out the solution but, should the result not be closer to £285,001?

It looks like you have priced the 10002 as 124999.
 
Upvote 0
The number of units does not seem to add up, see how i have worked it out below with two helper columns:
Book1
ABCDEFG
1QuantityRate per unitNumber of unitsTotal
250000£1.0050000£50,000.00385002£285,001.00
3100000£0.9050000£45,000.00
4150000£0.8050000£40,000.00
5250000£0.70100000£70,000.00
6375000£0.60125000£75,000.00
7500000£0.5010002£5,001.00
81000000£0.400£0.00
92000000£0.300£0.00
10385002£285,001.00
Sheet1
Cell Formulas
RangeFormula
D2:D9D2=C2:C9*B2:B9
G2G2=SUM(D2:D9)
C2:C9C2=LET(n,IF(A2<$F$2,A2-IF(ISTEXT(A1),0,A1),$F$2-IF(ISTEXT(A1),0,A1)),IF(n<0,0,n))
C10:D10C10=SUM(C2:C9)
Dynamic array formulas.
 
Last edited:
Upvote 0
The number of units does not seem to add up, see how i have worked it out below with two helper columns:
Book1
ABCDEFG
1QuantityRate per unitNumber of unitsTotal
250000£1.0050000£50,000.00385002£285,001.00
3100000£0.9050000£45,000.00
4150000£0.8050000£40,000.00
5250000£0.70100000£70,000.00
6375000£0.60125000£75,000.00
7500000£0.5010002£5,001.00
81000000£0.400£0.00
92000000£0.300£0.00
10385002£285,001.00
Sheet1
Cell Formulas
RangeFormula
D2:D9D2=C2:C9*B2:B9
G2G2=SUM(D2:D9)
C2:C9C2=LET(n,IF(A2<$F$2,A2-IF(ISTEXT(A1),0,A1),$F$2-IF(ISTEXT(A1),0,A1)),IF(n<0,0,n))
C10:D10C10=SUM(C2:C9)
Dynamic array formulas.
Thank you!!!

We had the number of units calculated from 50001 - 100000, so not quite the 50000. I can edit this on our main spreadsheet, but I will definitely give this a go.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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