Minimum rolling total of a series of cash flows in one cell

Billy8147

New Member
Joined
Mar 9, 2011
Messages
3
I am trying to calculate the minimum rolling total of a series of cash flows without using multiple cells. For example, cells A3:A11 contain the following values [-1,-1,-4,2,1,-5,8,2,-1] and I would like to put a formula in cell A1 which would return the value -8.

Any ideas?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
What is a "minimum rolling total" and how is it -8 for your example?
I am trying to calculate the minimum rolling total of a series of cash flows without using multiple cells. For example, cells A3:A11 contain the following values [-1,-1,-4,2,1,-5,8,2,-1] and I would like to put a formula in cell A1 which would return the value -8.

Any ideas?
 
Upvote 0
The "rolling total" for the series of values in my example would be -1, -2, -6, -4, -3, -8, 0, 2, 1.

The "minimum rolling total" would just be the min of those values (-8). The maximum rolling total would be 2.
 
Upvote 0
With your values in A3:A11


This regular formula returns the MINIMUM cumulative total:
Code:
B1: =MIN(INDEX(SUBTOTAL(9,OFFSET(A3,,,ROW(A3:A11))),0))
This regular formula returns the MAXIMUM cumulative total:
Code:
C1: =MAX(INDEX(SUBTOTAL(9,OFFSET(A3,,,ROW(A3:A11))),0))
In your example, the MIN is: -8
The MAX is 2

Is that something you can work with?
 
Upvote 0
If you can put the result in some other column than A, i.e., reserve A for the data series. Then use =MIN(A:A) for the minimum.

If you must put the result in A1 and the rest of A is for the series, use =MIN(A3:A{lastrow}) where {lastrow} is 65536 or 1048576 (Excel 2007 or later).

The "rolling total" for the series of values in my example would be -1, -2, -6, -4, -3, -8, 0, 2, 1.

The "minimum rolling total" would just be the min of those values (-8). The maximum rolling total would be 2.
 
Upvote 0
Hi, Tushar (you were missed in WA last week)

Unless I'm mistaken, I believe Col_A contains the actual values, not the cumulative totals. Hence, the complication. The single formula needs to calculate all cumulative totals: Sum(A2), SUM(A2:A3), SUM(A2:A4), etc
and return the max or min.
 
Upvote 0
Hi Ron,

Yeah, I had to cancel at the last minute.

Oh, I see. Billy8147 is adding up the values and then computing the min and max of those values. My bad.
Hi, Tushar (you were missed in WA last week)

Unless I'm mistaken, I believe Col_A contains the actual values, not the cumulative totals. Hence, the complication. The single formula needs to calculate all cumulative totals: Sum(A2), SUM(A2:A3), SUM(A2:A4), etc
and return the max or min.
 
Upvote 0
You're very welcome, Billy8147

One minor tweak to the formulas, though ...
Since the data does not start on Rol_1, we need to compensate:

MIN
Code:
B1: =MIN(INDEX(SUBTOTAL(9,OFFSET(A3,,,ROW(A3:A11)-ROW(A3)+1)),0))
MAX
Code:
C1: =MAX(INDEX(SUBTOTAL(9,OFFSET(A3,,,ROW(A3:A11)-ROW(A3)+1)),0))
 
Upvote 0
This works for data that is in a column but what if you are working with data in a row instead? And how do you compensate for it not being in the first column?
 
Upvote 0

Forum statistics

Threads
1,224,523
Messages
6,179,301
Members
452,904
Latest member
CodeMasterX

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