Overview
This adds a new column that shows a running balance in the Transactions sheet. You can configure which accounts show their balance, as well as how many transactions back in history you want to show the balance.
It’s a bit of a performance hog, so you don’t want to go too far back. By default, I have it set to just show the balance of the latest transaction for each account. As a point of reference, though, I have 7500+ transactions, and my sheet was only slowed a little when I had 8 accounts turned on and 30 transactions per account showing a balance.
Installation
Get the worksheet here (Tiller-Running-Total - Google Sheets):
- Copy the Transactions-Running Balance sheet into your Tiller sheet.
- Create a new column at the right of the Transactions sheet, and copy in this formula:
={"Running Balance";
LET(
rowsAll,MAP(INDIRECT('Transactions-Running Balance'!$G$3),LAMBDA(t,ROW(t))),
amountsAll,INDIRECT('Transactions-Running Balance'!$G$4),
accountAll,INDIRECT('Transactions-Running Balance'!$G$5),
transactionsIDAll,INDIRECT('Transactions-Running Balance'!$G$6),
MAP(
transactionsIDAll,
accountAll,
rowsAll,
LAMBDA(transID,account,row,
IF(
ISNUMBER(MATCH(transID,INDIRECT('Transactions-Running Balance'!$K$1),0)),
SUMIFS(amountsAll,accountAll,account,rowsAll,">="&row)+VLOOKUP(account,'Transactions-Running Balance'!$A$3:$B$12,2,false),
IFERROR(1/0)
)
)
)
)
}
If you get a “circular reference” error, that’s because the Transaction ID column is to the right of the Running Balance column. You can either turn on Iterative Calculation in the Google Sheets settings, or move the Running Balance column to the right of the Transaction ID column.
Setup
Cell B1 tells the formula how many historical transactions to calculate the balance on. By default I have it set to 1, which is just the most recent transaction for each account selected below. You can make this as high as you want, but be warned it takes a toll on your CPU.
A3:B12 is where you select which accounts to calculate the balance for. Column B is optional, and is if your entire account history ISN’T in the Transaction sheet, and you need to set a starting balance.
Usage
As you add new transactions to your sheet, the balance should update automatically.
Notes
I threw this together on a bit of a lark to see if I could do it, and it mostly does what I wanted. The big downside is the poor performance when you get too many accounts and/or transactions. I would love some advice from anyone on improving the efficiency of the balance calculation.
FAQ
Optionally, add common questions and answers…