MegaSack DRAW - This year's winner is user - rgwb
We will be in touch
Happy new year everyone.
I'm using google sheets to create a spending diary. I want to include a category code column so I can analyse my spending by category (A=food, B=bike stuff, etc)
So once I have assigned each entry a category code, how do I get the spreadsheet to add up the totals for each category?
Thanks
SUMIF is what you need
https://support.google.com/docs/answer/3093583?hl=en
So SUMIF (range containing codes, "A", range containing amounts)
Or a pivot table will do the same thing
Thank you mate
Brilliant that's all done, thank you.
One more for you. In my code column, I want code "X" to mean "no spending day". So for "X", I don't want to calculate the sum of anything, I just want it to count the number of X's in order to output "number of no spending days" for each month.
Ah found it. It's COUNTIF isn't it 🙂
Yeh I use sumif with a rolling total and an annual total. Works a treat.
I have a spreadsheet with six columns - date, description, debit amount, 'off' for come off bank, credit amount, category. My sumif function looks like this for 2018 '=-SUMIF(Accounts!$F$5756:$F$6469,"Bike",Accounts!$C$5756:$C$8469)', the negative at the start of the formula is to show debit amount as positive in the total. And at the end of 2018 I'll amend the last cell to sum to.
I've also added data validation to the category column so I have a pick list. This is the category list from the summary of spending table - so if I add a new category it'll add automatically to the dropdown list.
Yes I am fun at parties 🙂
And at the end of 2018 I'll amend the last cell to sum to
This kind of thing always makes me nervous. Maybe it matters less for what you're doing but in a work environment someone will inevitably forget/not know to change the sum range and then it all goes wrong. You could add a date field in and then do a SUMIF[u][b]S[/u][/b] with a front sheet where you type the year.
E.g
=SUMIFS(ACCOUNTS!C:C,ACCOUNTS!F:F,FRONTPAGE!A2,YEAR(ACCOUNTS!G:G), FRONTPAGE!B2)
Where the money values are in a accounts column c, the category is in accounts column f and frontpage cell A2 and the date is in accounts column g with the current year in frontpage cell B2.
Each year you just change the current year and all of your formulae update straightway.
Edit: I am also very fun at parties! 😀
