Forum Discussion
Lkiia
Aug 20, 2023Copper Contributor
Using Formula MONTH() in SUMIFS()
My simplified table looks like this - Date Category Amount 8/1/2023 Housing $100.00 8/1/2023 Groceries $200.00 9/1/2023 Groceries $100.00 9/1/2023 Utilites $200.00 I am...
HansVogelaar
MVP
MONTH(A:A) is not a range but an array.
The criteria_range arguments of SUMIFS must be ranges, not arrays.
You can use SUMPRODUCT instead:
=SUMPRODUCT(C2:C1000, (MONTH(A2:A1000)=8)*(B2:B1000="Groceries"))
(I'd use finite ranges instead of entire columns for reasons of performance.)
Alternatively, create a helper column. For example enter the following formula in D2:
=MONTH(A2)
and fill down. You can then use
=SUMIFS(C:C, D:D, 8, B:B, "Groceries")
Jlkirk
Mar 31, 2024Copper Contributor
what if there were various words in the cells under the Category heading in each cell instead of just "Groceries"? Can you still isolate Groceries? If so, how? Ive seen "*...*" used in sumif and sumifs formulas
- HansVogelaarApr 01, 2024MVP
Using the example from higher up:
=SUMIFS(C2:C1000, B2:B1000, "*Groceries*")
and
=SUMPRODUCT(C2:C1000, (MONTH(A2:A1000)=8)*ISNUMBER(SEARCH("Groceries", B2:B1000)))
- JlkirkApr 01, 2024Copper ContributorThank you