jasgot
New Member
- Joined
- Jul 16, 2002
- Messages
- 30
- Office Version
- 365
- 2019
- 2016
- 2013
- 2010
- Platform
- Windows
A | B |
---|---|
100 | 1 |
100 | 2 |
500 | 3 |
400 | 4 |
100 | 5 |
200 | 6 |
7 | |
200 | 8 |
100 | 9 |
100 | 10 |
I want to sum a maximum of the bottom five rows that have values. I want to skip the blank rows.
So the results of the formula in B10 should be 100+100+200+200+100 = 700
I will use this formula in an adjacent column to get a rolling sum of a maximum of the last five rows
Where there are not five rows, I just want the rows that have values
So the result in B1 will be 100 (A1:A1) - because there is only one row
the result in B2 will be 200 (A1:A2) - because there are only two rows
the result in B3 will be 700 (A1:A3)- because there are only three rows
the result in B4 will be 1100 (A1:A4) - because there are only four rows
the result in B5 will be 1200 (A1:A5) - because there are only five rows
the result in B6 will be 1300 (A2:A6) - because there are more than five rows
the result in B7 will be 1300 (A2:A6) - because we had to go up one more to get 5 values because A7 is empty
the result in B8 will be 1400 (A3:A8) - because we had to go up one more to get 5 values because A7 is empty
the result in B9 will be 1000 (A4:A9) - because we had to go up one more to get 5 values because A7 is empty
the result in B10 will be 700 (A5:A10) - because we had to go up one more to get 5 values because A7 is empty
I need the formula to determine which rows should be included (they must have a value) because I cannot hard code the range like I did here.
The goal is to sum the most recent five values, there may actually be several blanks that have to be skipped (sometimes).
Thanks.
Jason