Question posted 2012 · +4 upvotes
My table is as follows…
Timestamp | Category | Cost
--------------------------------
... | Shopping | 5
... | Charity | 10
... | Dining | 20
... | Mortgage | 1000
... | Dining | 30
etc...
What I need is a formula for each category value that will get the sum of the cost column for rows that have that category. ie. total spending in that category that I can place in the “actual spending” cell in my budget table. The data is input with a google form so I have almost no power over formatting.
Thanks for your help!
Accepted answer +10 upvotes
You could use multiple SUMIF() functions to place these sums anywhere in the spreadsheet. Assuming Column A is TimeStamp, Column B is Category, and Column C is Cost:
Shopping -> =SUMIF(B:B, "Shopping", C:C)
Charity -> =SUMIF(B:B, "Charity", C:C)
Dining -> =SUMIF(B:B, "Dining", C:C)
Mortgage -> =SUMIF(B:B, "Mortgage", C:C)
Top excel Q&A (6)
- Shortcut to Apply a Formula to an Entire Column in Excel +335 (2011)
- How should I escape commas and speech marks in CSV files so they work in Excel? +136 (2012)
- Convert xlsx to csv in linux command line +96 (2012)
- How to create a link inside a cell using EPPlus +50 (2011)
- IF statement: how to leave cell blank if condition is false ("" does not work) +44 (2013)
- T-SQL: Export to new Excel file +44 (2012)
excel solutions on this site
.