0

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

0

1 Answer 1

1

Use query(), like this:

=arrayformula( 
  query( 
    { 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' ", 
   1 
  ) 
)

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

Your Answer

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

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