How to calculate the total amount by month

Asked 2 years ago, Updated 2 years ago, 128 views

Column C contains the cumulative sumif and row functions of column B.

=ARRAYFORMULA(if(B2:B="", "", sumif(row(B2:B), "<="&row(B2:B), B2:B)))

Currently, even if the date in column A is March, the total amount is calculated regardless of April.

I would like to start this again from ¥0 when the month changes.

I have little knowledge of functions, but I put month(B2:B) in the sumif condition, but it didn't work out so I asked you a question.
I would appreciate it if you could give me some advice.

Enter a description of the image here

google-spreadsheet

2022-09-29 22:07

1 Answers

If the dates in column A are listed in ascending order, you can do the following:

=ARRAYFORMULA(IF(B2:B="", SUMIF(ROW(B2:B), "<="&ROW(B2:B), B2:B) - SUMIF(YEAR(A2:A)*100 + MONTH(A2:A), "<"&YEAR(A2:A)*100 + MONTH(A)*100 + MONTH(A))


2022-09-29 22:07

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.