I am using the formula from this question
=ArrayFormula(sum(sumif(A:A,{"Bus";"Train"},B:B)))
I am planning to use it for multiple categories. For example the above can a sum of my travel
category expenses. I want to sum my entertainment expenses. It will have a formula like
=ArrayFormula(sum(sumif(A:A,{"Movie";"Games"},B:B)))
The only difference between these will be the thing in the brackets. It would be great if I could place the array value in a cell like below
. C D
1 | category | category names |
2 | travel | {"Bus";"Train"} |
3 |entertainment | {"Movie";"Games"} |
And then use my formula like this
=ArrayFormula(sum(sumif(A:A, D2, B:B)))
Same for A:A
. I want to do sum every month so the only thing that is going to change will be A1:A100
for first month, A101:A:200
for second month and so on.
So how do I use values from other cells in my formulas?