# Create a running total based on a category

#### keeln

##### New Member
So I am making a spreadsheet to track expenses, and I created a dropdown list for each entry to assign it a category.

What I want to do is create a running total of how much money from each of the 6 categories that I have so I know what part each category attributes to the complete total. I'll have several entries to this needs to be applied to all of them.

So for example, A1 is the category ("cat1") B1 is an amount of money. The table would continue this trend downwards. Now, based on A1 I want to add B1 to the D1. D2 would be the sum of category 2 and so on.

I can try to explain more if need be. Thanks.

### Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

#### General Ledger

##### Active Member
It sounds like you have all your data in one Table, where column A is Category, column B is Amount, column C is Something, and column D is where you want the running totals based on Category. In that case, here is what I would do. Enter in cell D2 the formula =SUMIF(\$A\$2:A2,[@Category],\$B\$2:B2) Copy this formula down the entire Table.

This SUMIF formula should total the values of all records above the current record plus the current record which have the same Category as the current record.

Yes, this formula should continue to work correctly if you sort or otherwise rearrange the records.

Best of luck,

G/L

#### keeln

##### New Member
Nice! Worked like a charm! Thanks for your help!

Replies
0
Views
32
Replies
0
Views
34
Replies
1
Views
66
Replies
8
Views
139
Replies
16
Views
321

1,109,437
Messages
5,528,762
Members
409,834
Latest member
vexceled

### This Week's Hot Topics

• Change military grades into rank
Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
• VBA COUNTIF SOLUTION
Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
• INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...