# Spendings tracker - math formulas?

I am trying to build an app that helps me with my finances next year. Basically, to make sure that a set amount of \$3,800 will last me the whole year. The first section is simply where I have calculated how much money I will need, and how much per month I will have to spend for each category. The second section is where I input my spendings, which automatically are moved to the third section, with all my spendings. I want to know how to use formulas to 1. show how much money I have left to spend that month for each category, and 2. at the end of the month, to recalculate the next month’s “other” category to accommodate for my over-spendings/under-spendings of the last month. So, if my overall expenses of January are over or under my budget for that month, the extra money is put into or taken away from the “other” expenses category of February. I hope that makes sense… Thanks!

Definitely makes sense! You’re looking to a) track remaining budget for each category and b) adjust budget categories based on actual spend.

I would recommend breaking this down into yearly costs rather than monthly. It’s convoluted, but with your per-month budget, you calculate the yearly amount necessary. This is the `Budgeted Amount`. You’ll need another column for `Total Expenses =Spendings.filter(type = thisRow.category).sum()` and a third for `Remaining Budget (Year) =[Budgeted Amount] - [Total Expenses]`

This all sets you up for the magic: `Future Monthly Budget = [Remaining Budget (Year)] / (13 – Month( Today() ))`. This formula should calculate how much you’ll have left in future budgets. We use 13 to account for the one-indexing of months (Jan = 1).

The easiest way to implement this is, honestly, to have a table of each month with an `Actual Budget` that you fill in manually based on `Future Monthly Budget`. Then, you can use `Monthly Remaining Budget (Actual) = [Actual Budget] - Spendings.filter(month = thisRow)`. You need this separately because your future monthly budget will increase/decrease as you save and spend throughout the year.

Does that help? I’ll admit I wrote this without building it, so I may have made some syntax errors

Thanks! I will try this out.

Also I’ll put a quick plug here for my personal favorite budgeting app, Pennies, which is incredibly lightweight and no-fuss. Doesn’t integrate with anything, doesn’t auto-add so you realize you’re spending money, and has nice bright pretty colors. It’s free! Very good for tracking a budget, but not good for planning a budget.

1 Like