It is in fact possible to do rounding within a QUERY, but it needs to be done indirectly with a bit of maths. To do so, you have to exploit the (undocumented, I think) modulo operator (%). Replicating the answer given by player0:
=ArrayFormula(query(query(query({B:C,month(C:C&1)}, "select Col2, sum(Col1), Col3 where Col2 is not null group by Col2,Col3 order by Col3"),"select Col1,Col2,(Col2+100)-(Col2+100)%100"),"offset 1",0))
What we are doing here within the query is adding 100 to each amount, then from this subtracting (amount+100) modulo 100, which rounds the answer back down to the nearest hundred (achieving the same result as you requested). It should be possible to do account for other rounding scenarios by changing the addend and modulus accordingly.
Answer from The God of Biscuits on Stack OverflowVideos
It is in fact possible to do rounding within a QUERY, but it needs to be done indirectly with a bit of maths. To do so, you have to exploit the (undocumented, I think) modulo operator (%). Replicating the answer given by player0:
=ArrayFormula(query(query(query({B:C,month(C:C&1)}, "select Col2, sum(Col1), Col3 where Col2 is not null group by Col2,Col3 order by Col3"),"select Col1,Col2,(Col2+100)-(Col2+100)%100"),"offset 1",0))
What we are doing here within the query is adding 100 to each amount, then from this subtracting (amount+100) modulo 100, which rounds the answer back down to the nearest hundred (achieving the same result as you requested). It should be possible to do account for other rounding scenarios by changing the addend and modulus accordingly.
try:
=ARRAYFORMULA(SPLIT(REGEXREPLACE(FLATTEN(QUERY(TRANSPOSE({
QUERY({Expenses!B1:B, TEXT(MONTH(Expenses!C1:C&1), "00×")&Expenses!C1:C},
"select Col2,sum(Col1) where Col1 is not null group by Col2 label sum(Col1)''", ),
ROUNDUP(QUERY({Expenses!B1:B, TEXT(MONTH(Expenses!C1:C&1), "00×")&Expenses!C1:C},
"select sum(Col1) where Col1 is not null group by Col2 label sum(Col1)''", ), -2)}),,9^9)),
"(^\d+×)", ), " "))
