# How to Analyze Spending From CSV Bank Exports

> Clean a bank export and analyze spending from CSV files with pivot tables, a worked example, and fixes for refunds that distort monthly totals.

- Canonical: https://www.moneyos.cc/blog/analyze-spending-from-csv
- Author: MoneyOS (https://www.moneyos.cc/about)
- Category: Bank accounts and statements (https://www.moneyos.cc/blog/category/bank-accounts)
- Published: 2026-10-13T18:12:03.000Z
- Updated: 2026-10-13T18:12:03.000Z

To analyze spending from a CSV bank export, clean the file first, then summarize it. Fix the dates so they sort, make every purchase the same sign, delete header and summary rows, and remove transfers and income. Then add a category column and build a pivot table with categories down the side and months across the top.

This post walks through each step with a 30-row example file, shows which totals deserve your attention first, explains how refunds bend a month's number, and covers how to compare two months fairly. It ends with the point where a spreadsheet stops being the easy option.

## Cleaning a Spending CSV Before Analysis

Cleaning a spending CSV means turning the bank's export into one header row followed by one row per transaction, with real dates, numeric amounts and a consistent sign. Most exports need four fixes before any total is trustworthy, and doing them in a fixed order keeps you from undoing your own work.

If you have not downloaded a file yet, the post on [how to download and upload a bank statement for analysis](/blog/upload-bank-statement-for-analysis) covers where the export lives on a bank's website and which date range to pick.

### Remove stray rows at the top and bottom

Many bank exports start with a line or two that is not data, such as the account name, the masked account number or the date range of the export. Some end with a summary line or a blank row. A pivot table treats each of these as a transaction. Delete everything above the real column headers and everything below the last transaction. Then check that the first row holds headers like Date, Description and Amount, and nothing else.

### Make the dates real dates

A date stored as text sorts wrong. "10/02/2026" lands before "9/30/2026" because the sheet compares characters, not days. Select the date column and convert it to a date format, then sort by it. If some cells stay left-aligned after conversion, those cells are still text, often because the file mixes day-first and month-first formats or has a trailing space. Fix those by hand before moving on, because a pivot grouped by month will drop or misplace them.

### Pick one sign for spending

Banks disagree about signs. One export shows a $40 purchase as -40.00 and a deposit as 2450.00. Another shows both as positive and adds a Debit/Credit column. A third uses separate Debit and Credit columns. Choose one convention for your analysis. A simple one is to make spending positive and money coming back negative, so a category total reads as "what I spent." If the file has two columns, combine them into one with a formula that subtracts credits from debits.

### Take out rows that are not spending

Paychecks, interest, transfers to savings and credit card payments are not spending. A credit card payment from checking is especially misleading, because the purchases it pays off already appear on the card's own export, so keeping it counts them twice. Add a column called Type and mark these rows as Income or Transfer, then filter them out of the summary. Moving money between your own accounts is its own subject, and the post on [tracking several bank accounts in one place](/blog/multi-bank-account-tracker) explains how to spot transfers that show up on both sides.

## Pivot Tables for CSV Spending by Category and Month

A pivot table for CSV spending puts categories in rows, months in columns and the sum of the amount in the cells. Before you build it, add two helper columns to the cleaned file, a Category column and a Month column, because the pivot can only group by values that already exist in a column.

The Month column comes from the date with a formula that returns the year and month as text, such as "2026-08". Storing it as text in that order means August always sorts before September and the pivot does not split one month across two labels.

The Category column is where the work is. You can type a category on each row, or write a short list of rules that match merchant text and fill the column for you. Choosing categories and writing those rules is covered step by step in the guide to [categorizing transactions from a CSV file](/blog/categorize-transactions-from-csv). For a first pass, five to eight broad categories are enough.

### Worked example with a 30-row export

The file below is an example made up for this post. It covers August and September 2026 for one checking account and has already had its top line removed. Spending is negative, as the bank exported it.

```
Date,Description,Amount
08/02/2026,FRESHWAY MARKET #214,-86.40
08/03/2026,CITY TRANSIT RELOAD,-40.00
08/05/2026,NORTHSIDE POWER CO,-118.25
08/06/2026,LUNA TAQUERIA,-32.50
08/08/2026,STREAMBOX MONTHLY,-15.99
08/09/2026,FRESHWAY MARKET #214,-72.15
08/12/2026,HARBOR HOME GOODS,-64.00
08/13/2026,BEAN & LEAF CAFE,-9.75
08/15/2026,PAYROLL DEPOSIT ACME,2450.00
08/16/2026,FRESHWAY MARKET #214,-91.30
08/19/2026,QUICKFUEL 0331,-48.60
08/20/2026,HARBOR HOME GOODS REFUND,64.00
08/22/2026,LUNA TAQUERIA,-41.20
08/25/2026,TRANSFER TO SAVINGS,-300.00
08/27/2026,FRESHWAY MARKET #214,-68.90
09/01/2026,STREAMBOX MONTHLY,-15.99
09/02/2026,FRESHWAY MARKET #214,-94.10
09/03/2026,CITY TRANSIT RELOAD,-40.00
09/05/2026,NORTHSIDE POWER CO,-131.80
09/07/2026,BEAN & LEAF CAFE,-11.25
09/09/2026,FRESHWAY MARKET #214,-79.45
09/10/2026,PINE STREET BISTRO,-88.00
09/12/2026,GEARHUB ONLINE,-129.99
09/15/2026,PAYROLL DEPOSIT ACME,2450.00
09/16/2026,FRESHWAY MARKET #214,-83.60
09/18/2026,QUICKFUEL 0331,-52.40
09/21/2026,LUNA TAQUERIA,-36.75
09/23/2026,FRESHWAY MARKET #214,-70.20
09/25/2026,TRANSFER TO SAVINGS,-300.00
09/28/2026,GEARHUB ONLINE RETURN,40.00
```

Four rows come out before the pivot. The two payroll deposits are income and the two savings transfers are money you still have. That leaves 26 rows. Flipping the sign makes purchases positive, and the two refund rows become negative, so they reduce the Shopping total in the month they posted. With categories assigned, the pivot looks like this.

| Category | Aug 2026 | Sep 2026 | Two-month total |
| --- | --- | --- | --- |
| Groceries | $318.75 | $327.35 | $646.10 |
| Utilities | $118.25 | $131.80 | $250.05 |
| Dining | $83.45 | $136.00 | $219.45 |
| Transport | $88.60 | $92.40 | $181.00 |
| Shopping | $0.00 | $89.99 | $89.99 |
| Subscriptions | $15.99 | $15.99 | $31.98 |
| **Total** | **$625.04** | **$793.53** | **$1,418.57** |

Sort the rows by the total column, largest first, so the categories that move your month sit at the top. In this example groceries are the largest line in both months. Leaving aside the single GearHub purchase in Shopping, dining changed most, up $52.55 because of one $88 bistro dinner.

## Which Spending Totals From a CSV Actually Matter?

The first total worth reading from a CSV is the one for your largest category, followed by the category with the biggest change from the previous month. Together they tell you where most of the money goes and what is different this time. Grand totals matter less than people expect, because one unusual purchase can swing them.

After those two, look at fixed costs as a group. Utilities and subscriptions in the example add up to $134.24 in August and $147.79 in September. Fixed costs are the floor of your month. If that floor is creeping up, a small rise in every bill can matter more than one expensive dinner.

Next, count rather than sum. A pivot can show the number of transactions per category as well as the dollar total. In the example, dining has three rows in August and three in September, but the September total is far higher. That says the change came from one large purchase, not from eating out more often, which points to a different decision.

Finally, check the largest single rows. Sort the cleaned file by amount and read the top ten. Large purchases are rarely a surprise, but they explain most month-to-month swings, and reading them stops you from blaming a category for a change that came from one row. Pulling expenses out of a statement for a specific purpose, such as a reimbursement or a household split, is a separate task, covered in the guide to [extracting expenses from a bank statement](/blog/extract-expenses-from-bank-statement).

## Refunds and Reversals That Distort CSV Spending

Refunds and reversals distort CSV spending because they post on a different date from the purchase they cancel, and sometimes in a different month. A month can look too low when it absorbs a refund for an earlier purchase, or too high when a purchase lands before its refund does. Matching each credit to its original charge fixes both.

In the example, Harbor Home Goods charged $64.00 on August 12 and refunded it on August 20. Both rows fall in August, so Shopping for the month nets to zero. That is correct, since nothing was kept.

The GearHub rows behave differently. A $129.99 purchase posted on September 12 and a $40.00 partial return on September 28. Both landed in September, so the $89.99 net is right for that month. Had the return posted on October 2 instead, September would show $129.99 and October would show a negative Shopping total of -$40.00. Neither month would be wrong as a record of cash movement, but both would be wrong as a picture of what you spent.

There are two ways to handle a refund that crosses a month boundary. You can move the refund to the month of the original purchase with a note, which gives the truest spending picture. Or you can leave it where it posted and accept that some months carry a credit, which keeps the file matching the bank. Pick one and stick to it, because mixing the two makes month comparisons meaningless.

Watch for pending reversals too. A hotel or fuel station sometimes places a temporary hold that later drops off. If your export includes pending rows, the hold and its reversal can both appear, or the hold can appear alone. Exporting only posted transactions avoids both problems.

## How Do You Compare Two Months of CSV Spending?

You compare two months of CSV spending by lining up the same categories side by side, using the same cleaning rules for both months and the same treatment of refunds. Then compare each category's dollar change and its transaction count, rather than the grand total alone. A fair comparison changes one thing, the month, and nothing else.

Start with complete months. If one export ends on the 25th, the last days are missing, and that month will look cheaper than it was. In the example, both months are complete calendar months, so the comparison holds.

Next, account for timing quirks. A bill paid on the 31st one month and the 1st of the next can appear twice in one month and not at all in the other. The Streambox charge shows this risk. It posted on August 8 and on September 1, so a change of billing date could have put two charges in September. When a fixed bill seems to vanish or double, check the dates before reading anything into it.

Then read the change in two columns. The dollar difference shows size, and the percentage shows proportion. Dining in the example rose from $83.45 to $136.00, a $52.55 increase, about 63%. Utilities rose $13.55, about 11%. The dining change is bigger in both senses, but the utilities change is the one more likely to repeat, because a power bill tends to follow the season.

Comparing more than two months smooths out one-off swings. Three or more months side by side shows whether September is a new pattern or a single expensive weekend.

## When CSV Spending Analysis Outgrows a Spreadsheet

CSV spending analysis outgrows a spreadsheet when the monthly cleaning takes longer than the reading, or when you stop doing it at all. The usual signs are several accounts with different export formats, a rules list that needs fixing every month, and refunds you have to match by hand across files.

A spreadsheet remains a good choice for one account and a short category list. The setup is a one-time cost, and after that a new month takes a few minutes of pasting and refreshing. It also keeps the data entirely in your hands.

The work grows with every account you add. Each bank exports different columns, different signs and different description formats, so each needs its own cleaning steps. Card payments from checking have to be removed every time. Merchant names drift, so a rule that matched "FRESHWAY MARKET" last month misses "FRESHWAY MKT" this month. The post on [how to automate your personal finances](/blog/how-can-i-automate-my-personal-finances) looks at which of these chores are worth handing to a tool and which are better kept manual.

A tool built for transaction files does the cleaning and categorizing on import. MoneyOS is one example. You bring in the same CSV your bank already provides, and it sorts each row into a category, pulls out recurring charges and sets this month against last, and when it picks the wrong category you can correct it once and it remembers. The steps from file to summary are laid out in [how MoneyOS works](/#how-it-works).

Whichever route you take, keep the raw export. A copy of the original file lets you check any total later, and it is the evidence you need when a number looks wrong.
