Rjmr
Rjmr

Reputation: 19

Getting sum of the amount per month - Google Sheet

Below is the formula where D is the amount, C is the category, and A is the month with a format of "January 1, 2020"

=SUMIFS(Expenses!D2:D, Expenses!C2:C, "Food", TEXT(Expenses!A2:A, "MMMM"), "January")

However, I am getting "Array arguments to SUMIFS are of different size."

Upvotes: 0

Views: 512

Answers (1)

Alisson Miranda
Alisson Miranda

Reputation: 101

You need to use an arrayformula to make the text formula work.

Try this:

=SUMIFS(Expenses!D2:D, Expenses!C2:C, "Food", arrayformula(TEXT(Expenses!A2:A, "MMMM")), "January")

Be aware that Blank cells on Expenses!A2:A will output "December", to avoid that use:

=SUMIFS(Expenses!D2:D, Expenses!C2:C, "Food", arrayformula(IF(LEN(Expenses!A2:A),TEXT(Expenses!A2:A, "MMMM"),)), "January")

Upvotes: 2

Related Questions