Five Google Sheets formulas for bank transaction data (SUMIFS by category and month, running balance and more)

Last updated: December 5, 2026 · Etay Lev, Founder of Moneylogz

The short answer

With transactions in a tab named Transactions (date in A, description in B, category in C, amount in D), five formulas cover most money questions: SUMIFS for a category this month, SUMIFS with EOMONTH for monthly totals, SCAN for a running balance, QUERY for top merchants, and COUNTIFS to flag recurring charges.

Every formula below uses that same layout, with a header row in row 1 and data from row 2. If your columns sit elsewhere, change the letters once and the rest follows.

Before you start: check the sign of your amounts

Banks and feeds disagree on signs. Some write a $40 grocery charge as -40, some as 40. Look at a purchase you know and note which way your data goes. The formulas below assume spending is negative and money in is positive. If yours is the other way, either flip the comparison (<0 becomes >0) or add a helper column with =-D2 and point the formulas at it.

1. Spending in one category this month

=SUMIFS(Transactions!D:D, Transactions!C:C, "Groceries",
        Transactions!A:A, ">="&EOMONTH(TODAY(),-1)+1,
        Transactions!A:A, "<"&EOMONTH(TODAY(),0)+1)

EOMONTH(TODAY(),-1)+1 is the first day of the current month and EOMONTH(TODAY(),0)+1 the first day of next month, so the window moves with the calendar and never needs editing. To build a budget table, list your categories in column A of a Budget tab and replace "Groceries" with $A2, then fill down. The result is negative for spending; wrap it in -( ... ) if you want a positive number beside your budget.

2. Totals by category and month across a year

Put the first day of each month across row 1 of a Monthly tab (B1 is 1/1/2026, C1 is =EDATE(B1,1), filled right to December), your categories down column A, and this in B2:

=SUMIFS(Transactions!$D:$D, Transactions!$C:$C, $A2,
        Transactions!$A:$A, ">="&B$1,
        Transactions!$A:$A, "<"&EOMONTH(B$1,0)+1)

Fill it right and down. The dollar signs matter: $A2 keeps the category column fixed as you fill right, B$1 keeps the month row fixed as you fill down, and EOMONTH(B$1,0)+1 turns each month header into the first day of the following month. Add a total row with =SUM(B2:B20) and you have a twelve-month category report that updates whenever new transactions arrive.

3. Running balance

Sort the Transactions tab by date, oldest first. Put the account's opening balance in a cell, say G1, then in E2:

=SCAN(G1, D2:INDEX(D:D, COUNTA(A:A)), LAMBDA(balance, amount, balance + amount))

SCAN walks down the amounts and returns the running total at every row, in one formula that grows as rows are added. INDEX(D:D, COUNTA(A:A)) finds the last filled row, so empty rows below the data do not repeat the final balance. If you prefer a formula per row, put =$G$1+SUM($D$2:D2) in E2 and fill down; it gives the same result and is easier to read.

A running balance only matches your bank if the tab holds one account. With several accounts in one tab, filter to one account first, or compute balance by account with SUMIFS on an account column.

4. Top merchants by spending

=QUERY(Transactions!A:D,
  "select B, sum(D) where D < 0 group by B order by sum(D) asc limit 10 label sum(D) 'Spent'", 1)

QUERY groups the rows by description, sums the amounts, and returns the ten largest spenders, most negative first. The final 1 tells QUERY that row 1 holds headers. To limit it to this year, add and A >= date '2026-01-01' after D < 0.

Bank descriptions are messy: "AMZN Mktp US2K4" and "Amazon.com7Q1" count as two merchants. If that splits your top merchants, add a cleaned merchant column with =REGEXEXTRACT(B2, "^[A-Za-z ]+") or a lookup table, and group by that column instead.

5. Flag recurring charges

In F2, filled down:

=COUNTIFS($B:$B, B2, $D:$D, D2, $A:$A, ">="&EDATE(TODAY(),-4)) >= 3

This returns TRUE when the same description has been charged the same amount at least three times in the last four months, which is what a monthly subscription looks like. Filter column F to TRUE and you have a subscription list. Two adjustments make it sharper: lower -4 and 3 to catch newer subscriptions, and for annual renewals look back 13 months with a threshold of 2. Price changes break exact-amount matching, so scan the FALSE rows for familiar names once in a while.

Keep the Transactions tab filling itself

These formulas are only as current as the data under them. If you download CSVs, the guide to exporting bank transactions to Google Sheets shows how to append them without duplicates. If you would rather not download at all, a bank-sync add-on adds new rows every day; how to connect a bank account to Google Sheets compares the options. The Moneylogz Google Sheets add-on syncs from 12,000+ banks, cards and brokerages in the US and Canada through Plaid, read-only, with a category and sub-category already on each row, so formula 1 works the day you connect.

Frequently asked questions

How do I sum by category and month in Google Sheets? Use SUMIFS with three conditions: the category column equals the category, the date is on or after the first of the month, and the date is before the first of the next month. EOMONTH gives you both month boundaries.

How do I make a running balance in Google Sheets? Sort transactions by date, then use SCAN over the amount column starting from your opening balance, or put a cumulative SUM such as opening balance plus SUM of the amounts so far in each row.

Why does my SUMIFS return a negative number? Your data records spending as negative amounts. Wrap the formula in a minus sign to show spending as a positive number, or flip the sign in a helper column.

How can I find subscriptions in my bank transactions? Use COUNTIFS to count how often the same description and amount appear in the last few months. Three or more matching charges in four months usually means a monthly subscription.

Do these formulas work with a bank-sync add-on? Yes, as long as the synced tab keeps date, description, category and amount in fixed columns. If your add-on uses a different order, change the column letters in each formula once.

Want the Transactions tab to fill itself? Install Moneylogz from the Google Workspace Marketplace and start your 14-day free trial.

Contact Us

Request Financial Institution