0

I am learning Google Sheet and I am trying to create my own sheet to track expenses.

I have 1 drop down cell with date years (2022) and one cell with drop down with month (full name as in January)

I want to select the month and year and want to show all my expenses based on the selected year and month.

I have the month working, but I don't know how to integrate the year. What I know Is that my current code is using sumif, which only allows 1 criteria. So I should use "&" to add the year. ... but how?

={{ArrayFormula(sumif(ArrayFormula(text(Transacties!A2:A15;"MMMM")); unique(ArrayFormula(text(F2;"MMMM"))); Transacties!C2:C15))}}

1
  • Welcome to Web Apps Stack Exchange! I don't fully understand your formula, but this seems like a job for SUMIFS
    – David Tan
    Jul 15, 2022 at 2:48

1 Answer 1

1

Your formula repeats arrayformula() and is enclosed in two superfluous { array expressions }. It can be simplified to:

=arrayformula( sumif( text(Transacties!A2:A15, "MMMM"), text(F2, "MMMM"), Transacties!C2:C15 ) )

To match both year and month, use filter(), like this:

=sum( filter( Transacties!C2:C, text(Transacties!A2:A, "yyyyMMMM") = F2 & G2 ) )

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.