Sum Cells from Low to High and Pro rata the Last Value

andybason

Board Regular
Joined
Jan 7, 2012
Messages
217
Office Version
  1. 2016
Hi all,

It is difficult to summarise what I am trying to achieve the in the subject so I'll explain here:

In column B I insert values from 1-11.

This brings up values in columns C and D. I want to sum the values in column D based on the order in column B (from lowest to highest) stopping when the sum of the values in column C exceeds 24. When they exceed 24 the last value (based on the values in column B) in column D should be prorated.

So in this xl2bb it should be 25.1996 + 12.7992 + (12.00015 pro rated). The pro rated element here is 24 - (14.8 + 8.4).

I hope that makes sense. If not please ask!

Thanks


Cell Formulas
RangeFormula
C8:C25C8=IF(B8="","",INDIRECT("'"&A8&"'!N74"))
D8:D25D8=IF(B8="","",(C8*(VLOOKUP(A8,Summary!B10:V34,21,FALSE)/100)))
A8:A25A8=IF(Summary!B10="","",Summary!B10)
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Just one clarification, once you have assigned order 1-11 in column B, Can we sort data manually on the basis of Column B?
 
Upvote 0

Forum statistics

Threads
1,215,631
Messages
6,125,905
Members
449,273
Latest member
mrcsbenson

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