Search code examples
excelexcel-formulaexcel-2019

How to take the cumulative sum of a data up to a specific date with two contraints


enter image description here

I would like to take the cumulative sum of a stat for a specific date for a specific symbol and identifier. For example, I would like to take the cumulative sum of symbol "ABC" that contains the identifier "a" for the date "2021-08-13". The result is shown in the highlighted cell. A solution that is supported in Office 2019 is preferred. Thanks.


Solution

  • If you need the sum of just that date as ScottCraner had mentioned in his comment, although I'd adjust the full column reference to table named references (CTRL + T) or just the table length to reduce the weight on your system.

    =SUMIFS(D:D,A:A,"2021-08-13",B:B,"ABC",C:C,G2)

    If you need it up until a certain date, this is how you would achieve it (to exclude the date simply remove "="):

    =SUMIFS(D:D,A:A,"<=2021-08-13",B:B,"ABC",C:C,G2)