I have stumbled across this formula which calculates YTD spanning multiple years. I don't really understand what the *($A$3:$A$26<=$A3) part does in the formula. Without it, the formula does not work. I'd like to understand it a little better and perhaps the formula I have is not the best or most efficient way of calculating YTD when you have multiple years so am open to suggestions on how one might calculate YTDs within their particular years if you have data spanning many years.
Book10 | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | |||||
2 | Month | Amount | YTD | ||
3 | 1/01/2019 | 1,256 | 1,256 | ||
4 | 28/02/2019 | 1,369 | 2,625 | ||
5 | 31/03/2019 | 1,018 | 3,643 | ||
6 | 30/04/2019 | 1,406 | 5,049 | ||
7 | 31/05/2019 | 992 | 6,041 | ||
8 | 30/06/2019 | 1,364 | 7,405 | ||
9 | 31/07/2019 | 1,497 | 8,902 | ||
10 | 31/08/2019 | 1,322 | 10,224 | ||
11 | 30/09/2019 | 1,042 | 11,266 | ||
12 | 31/10/2019 | 1,214 | 12,480 | ||
13 | 30/11/2019 | 939 | 13,419 | ||
14 | 31/12/2019 | 1,284 | 14,703 | ||
15 | 31/01/2020 | 1,073 | 1,073 | ||
16 | 29/02/2020 | 1,424 | 2,497 | ||
17 | 31/03/2020 | 1,283 | 3,780 | ||
18 | 30/04/2020 | 973 | 4,753 | ||
19 | 31/05/2020 | 1,063 | 5,816 | ||
20 | 30/06/2020 | 971 | 6,787 | ||
21 | 31/07/2020 | 1,440 | 8,227 | ||
22 | 31/08/2020 | 1,191 | 9,418 | ||
23 | 30/09/2020 | 1,103 | 10,521 | ||
24 | 31/10/2020 | 882 | 11,403 | ||
25 | 30/11/2020 | 1,480 | 12,883 | ||
26 | 31/12/2020 | 1,383 | 14,266 | ||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C3:C26 | C3 | =SUM(FILTER($B$3:$B$26,(YEAR($A$3:$A$26)=YEAR($A3))*($A$3:$A$26<=$A3))) |