I use emacs org-mode and calc to keep track of my expenses. I've been using it for 2 months now and so far it has been mindblowing. Keeping track of expenses has never been more.. er.. fun. Got that right! FUN.
Here is my template:
* Monthly Base Expenses
* May
* June
* July
Inside each of the headlines I usually have a table that kind of looks like this:
| date | description | total |
|------+-------------+-------|
| 1 | cloud 9 | 6 |
| 6 | tempura | 10 |
| | sparkle | 7 |
| 7 | handuraw | |
| | beer | |
| | pizza | |
| | chili chips | 200 |
|------+-------------+-------|
| | total spent | 223 |
| ^ | | ts |
|------+-------------+-------|
| | money left | 777 |
| ^ | | ml |
#+TBLFM: $ts=vsum(@I..@II)::$ml=1000-@II+1
Some weird things in the table:
- The rows with "^" are marker rows. In these rows you define names for the fields above the row. So "ts" in the table is a marker for the value 223, which is the total spent money, then "ml" is the money left. These markers are used in the calculations in the table.
- The last row "#+TBLFM: $ts=vsum(@I..@II)::$ml=1000-@II+1" is where all formulas in the table go. You can see that we made use of the markers here.
The formulas:
$ts=vsum(@I..@II)
This is the computation for the total spent field:
- $ts = where the total spent value will be stored.
- vsum = is the sum function
- @I and @II = refers to the first and second hline (the line rows |----+----+----|)
So basically the formula says to add all values in the column of ts from the first hline (@I) to the second (@II).
$ml=1000-@II+1
- $ml = where the total money left value will be stored.
- 1000 = total money for the month (my salary)
- @II+1 = the field below the second hline (total spent amount)
Here we subtract the total money spent from the total money for the month.
How I update the table:
Everytime I add a new expense, I just place the cursor on the formula row and hit C-c and the total spent and money left fields get updated automatically. Pretty awesome. :)
Thoughts:
- I keep a separate table for the monthly base expenses so I'll always be up-to-date of how much money I can spend freely every month. This is also the initial template that I copy and paste when a new month starts.
- I separated the months per headline instead of using just one table because that way, I can hide the other months while viewing a specific month instead of viewing a very large table. Later I will have to separate it by years (if I'm still going to be using this method a year from now :p)
- I sync this file via dropbox, so that I can access it in any machine.
Why this?
- Handling text is just easier in emacs or vi or any editor that has shortcut keys.
- Spreadsheets can get messy when data gets bigger, in org-mode I simply "fold" it.
- This file is saved in plain text format, which means it can be opened by any plain text editor. Spreadsheet files can only be opened by spreadsheet software.
- Currently the size of my file is 6kb. When I save a new empty spreadsheet in Libre Office, it's already 7kb.
- I get to use emacs.
For Vi users, there are also org-mode counterparts, like vimorganizer.