Search code examples
excelexcel-formulaexcel-2019

How to take the cumulative sum of data up to a specific date?


I would like to find a formula that takes the cumulative sum up until a specific date specified. Ideally a formula that contains the date function so the user can select which date to have the cumulative sum of. For example:

Cumulative sum excel example

In this example I chose a specific date in the highlighted cell and the corresponding answer it should have using the correct formula.


Solution

  • One way is to use FILTER if you have the newest version of Excel.

    For example: =SUM(FILTER($J$2:$J$5, $I$2:$I$5<=I8))

    Another way is to use SUMIF. For example: =SUMIF($I$2:$I$5, "<="&I8, $J$2:$J$5)

    enter image description here