Given that image below, B is date in format [month/day/year] and salary.

From that date, can we total up salary from specific month in yellow table?

For instance, we want the total number of salary from white table, how to do it without adding one by one?

I suspected that we use something like, (if the month of the date is january, take that value of the salary).

Thank you

enter image description here


1 Answer 1


Use query(), like this:

    { eomonth(B2:B, -1) + 1, C2:C },
    "select Col1, sum(Col2) 
     where Col1 is not null 
     group by Col1 
     label Col1 'month' 
     format Col1 'mmmm yyyy' ", 

See query(), eomonth() and { array expressions }.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.