16.1 Count date by year and month

 

Here below is a data table:

imagepng

Now we want to calculate the sum of values in column Val by the year and month in column Date, the result is as follows:

imagepng

Script:

=spl("=E(?1).run(Date=date(""18991230"",""yyyyMMdd"")+Date).groups(month@y(Date):YM;sum(Val):Total)",A1:B11)

Group the dates in column Date by year and month, and then calculate the sum of the corresponding data in column Val; the option @y following the month means that the parameter includes the year data, and a 6-digit number will be returned. 


https://c.scudata.com/article/1651916536524
https://c.scudata.com/article/1659317654097
https://c.scudata.com/article/1659406463912