Skip to main content
Back to Articles

Categorize Bank Transactions in Excel with Pivot Tables

Step-by-step tutorial: import your bank statement into Excel, add categories with VLOOKUP, and build a pivot table to analyze spending by category and month.

Every month, the same ritual: a PDF lands in your inbox, and you spend the next hour manually typing transactions into a spreadsheet. If your goal is to categorize bank transactions in Excel with a pivot table, that copy-paste stage is the biggest bottleneck—and the most error-prone. The good news is that once your data is clean and structured, Excel’s built-in tools can turn a chaotic list of debits and credits into a clear, category-by-category spending report in under ten minutes. This tutorial walks you through every step, from getting the data into Excel to building a monthly breakdown pivot table you can actually use for bookkeeping, tax prep, or cash flow analysis.

Accountant categorizing bank transactions in Excel with a pivot table on screen

Step 1 — Get Your Bank Statement Data into Excel

Before you can categorize anything, you need the raw transaction data inside Excel as structured rows and columns. Bank statements arrive in PDF format by default, which means the first challenge is extraction.

There are three common methods to move from PDF to spreadsheet.

Method 1: Copy and paste from the PDF. Open the PDF in your browser or a PDF reader, select all the text in the transaction table, and paste it into Excel. This sounds simple but almost always produces garbled output: amounts that land in the wrong columns, dates that Excel refuses to recognize as dates, and merged rows that require manual cleanup before you can do anything useful.

Method 2: Download a CSV or OFX from your bank portal. Most business banking portals let you export transactions directly in CSV or OFX format for a selected date range. The resulting file opens cleanly in Excel with proper columns. The limitation is that you are working with one account at a time, exports are often limited to 90-day windows, and the column headers and date formats vary by institution.

Method 3: Use a PDF extraction tool. Tools like BankStatementLab parse your PDF bank statement and output a clean, structured Excel or CSV file with consistent columns—Date, Description, Amount—regardless of the original PDF’s layout. This is the fastest and most reliable method, especially when you are dealing with multiple statements or multi-page PDFs.

MethodSpeedAccuracyManual Effort
Copy-paste from PDFFast to startLow — frequent formatting errorsHigh — significant cleanup required
CSV export from bank portalMediumHigh — clean dataLow — but limited date ranges
PDF extraction tool (e.g. BankStatementLab)Very fastVery high — structured outputMinimal — ready to use immediately

Whatever method you use, your goal at the end of this step is a clean Excel sheet with at minimum four columns: Date, Description, Amount (or separate Debit / Credit columns), and a blank Category column ready to fill in.

Format your data range as an Excel Table (select the range, then Insert > Table). This makes pivot tables dramatically easier to work with because named table references update automatically when you add rows.

Step 2 — Set Up Your Category Column

With your transactions in a proper Excel table, it is time to assign a category to each row. This is the core of the exercise—every downstream analysis depends on the quality of this column.

Define your category list

Before you start tagging transactions, decide on your categories. Using ad-hoc labels (“Misc”, “Stuff”, “Amazon?”) produces a pivot table that tells you nothing. Use a consistent, business-relevant taxonomy instead.

Here are the standard categories most SMBs and accountants use:

CategoryExample TransactionsAccounting Type
Cost of Goods SoldRaw materials, direct labor, wholesale inventoryCOGS
PayrollSalary transfers, payroll processor fees, contractor paymentsOpEx
Rent & FacilitiesOffice rent, coworking space, storage unitOpEx
Software & SubscriptionsSaaS tools, cloud hosting, licensesOpEx
Marketing & AdvertisingAd spend, agency fees, print materialsOpEx
Travel & TransportationFlights, hotels, fuel, mileage reimbursementsOpEx
Meals & EntertainmentBusiness lunches, client dinnersOpEx
Professional ServicesAccountant, lawyer, consultant invoicesOpEx
Office SuppliesStationery, printer ink, small equipmentOpEx
Utilities & TelecomsElectricity, internet, phone billsOpEx
Bank Fees & InterestWire fees, monthly account fees, overdraft interestNon-operating
Tax PaymentsVAT remittances, income tax installmentsNon-operating
Transfers & InternalAccount-to-account transfers, credit card paymentsExcluded
UncategorizedTransactions pending review

Keep this list in a separate sheet called Categories (a single column, starting at A1). You will reference it in the next step.

Use a dropdown list for faster entry

Instead of typing category names by hand (which introduces spelling variants that break your pivot table), create a validation dropdown:

  1. Select the entire Category column in your transactions table.
  2. Go to Data > Data Validation.
  3. Under Allow, select List.
  4. In the Source field, point to your Categories sheet: =Categories!$A:$A.
  5. Click OK.

Now every cell in the Category column shows a dropdown. One click, no typos.

Use VLOOKUP to pre-fill categories automatically

For repeat transactions, you can build a lookup table to auto-assign categories. Create a second sheet called Rules with two columns: Keyword and Category. Populate it with patterns from your most common transactions—for example, “ADOBE” maps to “Software & Subscriptions”, “MONTHLY RENT” maps to “Rent & Facilities”.

In the Category column of your transaction table, use this formula (adjust column references as needed):

=IFERROR(VLOOKUP("*"&B2&"*", Rules!$A:$B, 2, FALSE), "")

This performs a wildcard match against your Description column (column B in this example). When a description contains a keyword from your Rules table, the category fills in automatically. Transactions that do not match any rule return blank and can be filled manually using the dropdown.

For Excel 365 users, XLOOKUP with the * wildcard operator offers more flexibility and cleaner handling of unmatched rows—replace the VLOOKUP formula with:

=IFERROR(XLOOKUP("*"&B2&"*", Rules!$A:$A, Rules!$B:$B, "", 0, 2), "")

The 2 in the last argument enables wildcard matching mode.

Step 3 — Build a Pivot Table to Analyze Spending

Once every transaction row has a category, building the summary pivot table takes about two minutes.

Create the pivot table

  1. Click anywhere inside your transaction table.
  2. Go to Insert > PivotTable.
  3. Excel detects the table range automatically. Choose New Worksheet as the destination and click OK.
  4. A blank pivot table appears with the PivotTable Fields pane on the right.

Configure the fields

Drag the fields into the following areas:

  • Rows: Category
  • Values: Amount (summarize by Sum)

At this point you already have a clean total by category. Every row in the pivot table represents one spending category and the total spent in that category across your entire date range.

If your original data has separate Debit and Credit columns rather than a single signed Amount column, add the Debit field to the Values area and summarize by Sum. You can add the Credit column as a second value to show inflows alongside outflows.

Format the values as currency

Right-click any number in the Values area, choose Number Format, and select Currency with two decimal places. This prevents the pivot table from displaying long decimals that make the table hard to read.

Sort by total spend

Right-click the Grand Total column and choose Sort > Largest to Smallest. Your highest-spend categories bubble to the top, making it immediately obvious where the money is going.

Excel pivot table showing bank transactions categorized by spending type and month

Step 4 — Create a Monthly Breakdown by Category

A single-column pivot table tells you totals for the period. To see trends—whether your software spend is creeping up, whether your travel budget spiked in a particular month—you need to add the time dimension.

Add the Date field and group by month

  1. Drag the Date field into the Columns area of the PivotTable Fields pane.
  2. Excel may automatically group dates by year and month. If it does not, right-click any date value in the pivot table, choose Group, and select Months (hold Ctrl to select both Months and Years if your data spans multiple years).

Your pivot table now has categories on the rows and months across the columns. Each cell shows the total spending for that category in that month.

Expected output

Here is what a well-structured monthly breakdown looks like for a typical SMB:

CategoryJanFebMarQ1 Total
Payroll12,40012,40012,90037,700
Rent & Facilities2,2002,2002,2006,600
Software & Subscriptions1,8401,8402,1105,790
Marketing & Advertising3,5004,2003,80011,500
Professional Services1,20002,4003,600
Travel & Transportation6804201,3502,450
Meals & Entertainment3102904801,080
Office Supplies14590210445
Bank Fees & Interest625864184
Grand Total22,33721,49825,51469,349

This format works directly as a management report. You can paste it into a board deck, share it with your accountant, or use it as the basis for a budget-versus-actual comparison.

Add a chart for faster communication

With the pivot table selected, go to PivotTable Analyze > PivotChart and choose a Stacked Column chart. Excel generates a chart that updates automatically whenever the pivot table data changes. Stacked columns show both the total monthly spend and the category composition at a glance.


Spending too much time copying transactions from your PDF bank statement into Excel? BankStatementLab extracts all your transactions automatically—dates, amounts, descriptions—ready to paste into your Excel template. Try it free →


Common Mistakes and How to Fix Them

Even with the right setup, a few recurring issues can break your pivot table or produce misleading totals.

1. Dates that Excel does not recognize as dates

If you copy-pasted from a PDF or imported an oddly formatted CSV, Excel may store dates as plain text. Text dates do not group correctly in pivot tables—instead of seeing “Jan”, “Feb”, “Mar”, you see each date as a separate row. Fix this by selecting the Date column, going to Data > Text to Columns, and walking through the wizard to tell Excel the date format (DMY, MDY, or YMD depending on your source).

2. Separate Debit and Credit columns instead of a single Amount column

Many bank statement exports use two columns: one for money out (Debit) and one for money in (Credit), with the other cell left blank. If you try to sum a single Amount column that does not exist, your pivot table shows nothing. Either create a calculated Amount column (=IF(C2<>"", -C2, D2) to treat debits as negative) or add both Debit and Credit as separate Values in your pivot table.

3. Inconsistent category names

“Software”, “Software & Subs”, and “software & subscriptions” are three different pivot table rows. One typo collapses the value into a separate bucket. Prevention: always use the dropdown list rather than typing. Fix existing inconsistencies with Find and Replace (Ctrl+H) before building your pivot table.

4. Duplicate transactions from copy-pasting

When you paste data from a PDF that spans multiple pages, it is easy to accidentally include the header row from page two, or to paste the same date range twice. This doubles your totals without any error message. Fix: sort by Date and Amount, then use Data > Remove Duplicates specifying all relevant columns.

5. Transfer and internal transactions inflating expense totals

A payment from your business account to your credit card is not an expense—it is a settlement of a liability. If you categorize it as an expense, your OpEx total is overstated. Always create a “Transfers & Internal” category and exclude it from your expense analysis, or filter it out in the pivot table before sharing the report.

6. Blank categories left as “Uncategorized”

Uncategorized rows aggregate into a single row in the pivot table, which hides spending you cannot explain. Make a rule: no statement is “done” until the Uncategorized row is empty. Schedule a weekly 15-minute review to assign categories to any unmatched transactions.

Going Further — Automate the Categorization

The workflow above works well for monthly statement processing. But if you are handling high transaction volumes, or managing books for multiple entities, manual category assignment—even with dropdowns and VLOOKUP—becomes a bottleneck.

Advanced VLOOKUP and IF logic

Extend your Rules table to handle more cases. You can nest IF statements to apply different categories based on amount ranges (a charge under €20 at a restaurant is likely a team coffee, above €200 it might be a client dinner with different tax treatment). Combine this with TEXT(date, "MMMM") to detect month-specific patterns like quarterly tax payments.

Power Query for repeatable processing

If you process statements monthly, Power Query (Excel’s built-in ETL engine) lets you record the full transformation pipeline once—import, clean, add Category column, apply lookup rules—and replay it with a single Refresh click every month. Go to Data > Get Data > From File > From Excel Workbook and walk through the transformation steps in the Power Query Editor. Save the query. Next month, drop the new export in the same folder, change the file path in the query settings, and click Refresh. The entire cleaned, categorized table regenerates automatically.

Pre-categorized extraction

Some PDF-to-Excel tools go further than simple extraction. BankStatementLab, for example, can output transactions with a pre-populated category column based on keyword matching built into the extraction pipeline. This means when your Excel file lands, most transactions are already tagged, and you only need to review and correct exceptions. For accountants processing statements for multiple clients, this cuts categorization time by 70 to 90 percent compared to starting from a blank Category column.

PivotTable Slicers for interactive reporting

Once your monthly breakdown pivot table is set up, add Slicers (PivotTable Analyze > Insert Slicer) on Category and/or Month. Slicers turn your static table into an interactive dashboard: click a category to see only that category’s monthly trend, or click a month to see all categories for that period. This is particularly useful for client-facing reports where the recipient wants to explore the data themselves.

Conclusion

Categorizing bank transactions in Excel with a pivot table is one of the highest-leverage things you can do for your financial visibility. The process has four clear phases: get clean data into Excel, assign a category to every transaction, build the pivot table, and add the monthly dimension. Done right, the result is a management-ready spending report that updates automatically as you add new statement data.

The pivot table itself takes minutes to build. The hard part—the part most people underestimate—is getting clean, structured transaction data out of a PDF bank statement in the first place. That is the step where most Excel workflows stall.

BankStatementLab eliminates that bottleneck. Upload your PDF bank statement and get a clean, Excel-ready file with dates, descriptions, and amounts properly structured—in seconds. Start for free →


---
🎁 5 credits on signup, then 5/month
💎 1 credit = 1 page

Ready to Automate your Excel exports?

Transform your bank statement PDFs into usable Excel files in seconds.

Try BankStatementLab
Written by bankStatementLab Team