google-sheets

Trying to add a value from a specific column from a specific date


I'm trying to add all of the cards sorted month by month. How can I make it so that as the table is filled it can automatically populate and update data. For example

January Cards Sorted: 1262
February Cards Sorted: 1543

If possible id like it to update even if there are more rows added to January. Id like to use this data to calculate metrics such as (Cards sorted) and (Cards per hour) if you have other ways to do this more efficiently please let me know.

A portion of the sorting sheet

Big table id like to fill with data

Simplified Tables
|   Date   |  Cards   |         |Month ||Total |
|          |          |         |------||------|
| -------- | -------- |         | Jan  || 827  |
| 1/2/25   | 120      |         | Feb  || 399  |
| 1/23/25  | 154      |
| 1/25/25  | 450      |
| 1/30/25  | 123      |
| 2/2/25   | 165      |
| 2/12/25  | 234      |

I've been doing everything manually with the tables such as using formulas like

`=sum(Archie[Hours Sorted])`
and
`=sum(B2:I14)`

I'm trying to set up a version I don't have to keep returning to and keep upkeeping.


Solution

  • You need QUERY() function. Try-

    =QUERY({INDEX(EOMONTH(A2:A,0)),B2:B},"select Col1, sum(Col2) where Col2>0 group by Col1 label sum(Col2) '' format Col1 'MMM'",0)
    

    Input (A:B Column):

    Date Cards
    1/2/25 120
    1/23/25 154
    1/25/25 450
    1/30/25 123
    2/2/25 165
    2/12/25 234

    Output from above formula-

    Date Cards
    Jan 847
    Feb 399