PPRuNe Forums - View Single Post - Excel Rolling 2-year totals
View Single Post
Old 5th Jun 2019, 22:27
  #4 (permalink)  
ExGrunt
 
Join Date: Mar 2003
Location: England
Posts: 286
Likes: 0
Received 0 Likes on 0 Posts
Originally Posted by Manchester
...
Column D: {=INDEX($A$2:$A2,MATCH(TRUE,$A$2:$A2>C2,0))} [enter the formula less the outer squirly brackets them press Control, Shift and Enter to enter it; the squirly brackets will return] [it’s an array, whatever that is]
Column E: =SUM(INDIRECT(CELL("address",INDEX(A$22,MATCH(D2,A$2:A2,0) ,2))):B2) except when I post that, an emoji appears in place of "colon D" so change it back.
...
As an Excel user that approach simply offends my eyes.

The answer to your problem is array multiplication. Please try the following array formula in column D:

Assuming your last row with data is row 999:

{=SUM(($B$2:$B$999)*(($A$2:$A999)>=C2))}

For the purists, I would use named ranges rather than absolute references, but that is a lesson for another day. For the moment, just remember that you have to update the last row reference whenever you add more data rows.

HTH

EG

Last edited by ExGrunt; 5th Jun 2019 at 22:38. Reason: typo
ExGrunt is offline