Skip to main content
Back to Articles

How to Auto Categorize Bank Transactions in Excel

Step-by-step guide to automatically categorize bank transactions in Excel using formulas, pivot tables, and smart automation tools.

If you run a freelance business or manage a small company, you already know the pain. Every month, you download your bank statement, open it in Excel, and face hundreds of rows of raw transactions. Rent payments, software subscriptions, client deposits, office supplies — all jumbled together with cryptic descriptions. Manually tagging each line takes hours, and one misclassified entry can throw off your entire budget.

There is a better way. Learning how to auto categorize bank transactions in Excel can save you significant time each month and dramatically improve the accuracy of your bookkeeping. In this step-by-step guide, you will learn three proven methods — from simple formulas to pivot tables — so you can build a system that works for your workflow.

Freelancer reviewing auto-categorized bank transactions in an Excel spreadsheet

Why Categorizing Bank Transactions Matters

Before diving into formulas, let’s clarify why categorization is worth the effort in the first place. Raw transaction data is just noise until you organize it into meaningful groups. Here is what proper categorization unlocks:

  • Cleaner bookkeeping. When every transaction has a category, your books close faster at month-end. You spend less time reconciling and more time on actual work.
  • Smarter budgeting. Category totals let you see exactly where money goes. You can spot overspending on subscriptions or identify your most profitable revenue stream at a glance.
  • Easier tax preparation. When tax season arrives, you need expenses sorted by type. If your transactions are already categorized, generating the numbers your accountant needs takes minutes, not days.
  • Cash flow visibility. Grouping transactions by category reveals patterns over time — seasonal dips, growing costs, or clients who consistently pay late.

Common Transaction Categories

Here is a reference table of categories that most freelancers and small business owners find useful. You can customize this list to match your business:

CategoryExamples of Transactions
Revenue / SalesClient payments, invoice deposits
Rent / LeaseOffice rent, coworking space fees
Software & SaaSAccounting tools, design software, hosting
Office SuppliesStationery, printer ink, desk accessories
Travel & TransportFuel, train tickets, parking fees
Meals & EntertainmentClient lunches, team dinners
Professional ServicesLegal fees, accounting, consulting
InsuranceBusiness liability, health coverage
UtilitiesInternet, phone, electricity
Bank Fees & InterestService charges, overdraft fees
TaxesEstimated payments, VAT remittances
MiscellaneousUncategorized or one-off transactions

Keep this table handy. You will use it as the foundation for the lookup table in Method 1.

Method 1: Using Excel Formulas to Auto Categorize Transactions

This is the most popular approach and works in every version of Excel. The idea is simple: you create a lookup table that maps keywords found in transaction descriptions to categories. Then a formula scans each description and assigns the matching category automatically.

Step 1: Set Up Your Transaction Data

Your bank statement data should be organized in a table with at least these columns:

Column A: DateColumn B: DescriptionColumn C: AmountColumn D: Category
01/15AMZN MKTP US-45.99(formula goes here)
01/15DEPOSIT - CLIENT PAYMENT2,500.00(formula goes here)
01/16GOOGLE *WORKSPACE-14.40(formula goes here)
01/17FUEL STATION #4421-52.30(formula goes here)

Column D is where the magic happens. But first, you need the lookup table.

Step 2: Create a Keyword-to-Category Lookup Table

On a separate sheet (or to the right of your data), create a two-column table. Column 1 holds a keyword that appears in the transaction description. Column 2 holds the category you want assigned.

Keyword (Column F)Category (Column G)
AMZNOffice Supplies
GOOGLESoftware & SaaS
ADOBESoftware & SaaS
FUELTravel & Transport
UBERTravel & Transport
DEPOSITRevenue / Sales
PAYMENTRevenue / Sales
RENTRent / Lease
INSURANCEInsurance
LEGALProfessional Services

The more keywords you add over time, the more accurate the system becomes. Start with your most frequent transactions and expand from there.

Step 3: Write the Categorization Formula

Now, in Column D of your transaction data, enter this formula (assuming your keyword table is in F2:G20):

=IFERROR(INDEX($G$2:$G$20, MATCH(TRUE, ISNUMBER(SEARCH($F$2:$F$20, B2)), 0)), "Uncategorized")

Important: This is an array formula. In older versions of Excel, you must press Ctrl + Shift + Enter instead of just Enter. In Excel 365 or later, pressing Enter works normally because these versions handle dynamic arrays natively.

Here is what each part does:

  • SEARCH($F$2:$F$20, B2) — Checks if any keyword from your lookup table appears inside the description in cell B2. SEARCH is case-insensitive, which is ideal for messy bank descriptions.
  • ISNUMBER(…) — Converts the SEARCH results into TRUE/FALSE. TRUE means the keyword was found.
  • MATCH(TRUE, …, 0) — Finds the position of the first TRUE value, which tells us which keyword matched.
  • INDEX($G$2:$G$20, …) — Returns the category from the matching row.
  • IFERROR(…, “Uncategorized”) — If no keyword matches, the transaction is labeled “Uncategorized” so you can review it later.

Step 4: Drag the Formula Down

Copy cell D2 and paste it down to all your transaction rows. Every transaction with a matching keyword will now have its category filled in automatically.

Alternative: Nested IF + SEARCH (Simpler but Limited)

If you only have a handful of categories, a nested IF formula can work:

=IF(ISNUMBER(SEARCH("AMZN", B2)), "Office Supplies",
 IF(ISNUMBER(SEARCH("GOOGLE", B2)), "Software & SaaS",
 IF(ISNUMBER(SEARCH("FUEL", B2)), "Travel & Transport",
 IF(ISNUMBER(SEARCH("DEPOSIT", B2)), "Revenue / Sales",
 "Uncategorized"))))

This approach is easier to read but becomes unwieldy beyond 7-10 categories. The INDEX/MATCH method from Step 3 is far more scalable.

Formula Comparison Table

Formula ApproachBest ForScalabilityEase of Maintenance
Nested IF + SEARCHFew categories (under 10)LowMust edit formula each time
INDEX/MATCH + SEARCHMany categories (10-100+)HighJust add rows to lookup table
XLOOKUP + SEARCH (Excel 365)Modern Excel usersHighCleanest syntax

Bonus: XLOOKUP for Excel 365 Users

If you have Excel 365, you can use XLOOKUP with a helper approach using the LET function:

=LET(
  desc, B2,
  keywords, $F$2:$F$20,
  categories, $G$2:$G$20,
  idx, XMATCH(TRUE, ISNUMBER(SEARCH(keywords, desc)), 0),
  IF(ISNUMBER(idx), INDEX(categories, idx), "Uncategorized")
)

This achieves the same result with cleaner, more readable syntax.


Tired of manually sorting hundreds of transactions? BankStatementLab extracts and pre-categorizes your bank statement data automatically. Try it free →


Method 2: Pivot Tables for Transaction Analysis

Once your transactions are categorized (whether by formula or manually), pivot tables become your most powerful analysis tool. A pivot table can summarize hundreds of transactions into a clear financial overview in seconds.

Step 1: Format Your Data as a Table

Select your entire transaction dataset (including headers) and press Ctrl + T to convert it into an Excel Table. This ensures the pivot table will automatically include new rows as you add more transactions.

Step 2: Insert a Pivot Table

  1. Click anywhere inside your table.
  2. Go to Insert > PivotTable.
  3. Choose to place the pivot table on a new worksheet.
  4. Click OK.

Step 3: Configure the Pivot Table

Drag and drop fields into the pivot table areas:

  • Rows area: Drag the Category field here. This creates one row per category.
  • Values area: Drag the Amount field here. Excel will sum all amounts for each category by default.
  • Columns area (optional): Drag the Date field here and group it by month to see a monthly breakdown.

Your pivot table now shows total spending and revenue per category. At a glance, you can see that you spent a certain amount on Software & SaaS or that Revenue / Sales totaled a certain amount for the period.

Step 4: Add a Pivot Chart

With your pivot table selected, go to Insert > PivotChart and choose a bar chart or pie chart. This gives you an instant visual breakdown of where your money goes — perfect for monthly reviews or presentations to partners.

Excel pivot table and bar chart showing business expenses broken down by category

Pro Tips for Pivot Tables

  • Filter by date range. Use the Report Filter area to add the Date field and filter by specific months or quarters.
  • Sort by amount. Right-click any value in the pivot table and select Sort > Largest to Smallest to quickly spot your biggest expense categories.
  • Refresh regularly. When you add new transactions to your source table, right-click the pivot table and choose Refresh to update the numbers.
  • Use slicers. Insert a Slicer (Insert > Slicer) for a visual filter. This is especially useful if you share the file with a business partner or accountant.

Common Categorization Mistakes and How to Fix Them

Even with formulas in place, errors can creep in. Here are the most frequent pitfalls and how to avoid them:

1. Keywords That Are Too Generic

A keyword like “PAY” will match “PAYMENT FROM CLIENT” (revenue) but also “PAYPAL SUBSCRIPTION” (expense). The fix: use more specific keywords. Instead of “PAY”, use “PAYMENT FROM” for revenue and “PAYPAL” for subscriptions.

2. Overlapping Keywords

If your lookup table contains both “AMAZON” and “AMZN”, and a transaction description includes “AMZN”, Excel will match whichever keyword appears first in the lookup table. Make sure your keyword list does not have redundant entries that could cause conflicts. Order your keywords from most specific to least specific.

3. Ignoring “Uncategorized” Transactions

The whole point of the “Uncategorized” fallback is to flag transactions that need your attention. Make it a habit to filter for “Uncategorized” at the end of each month and either:

  • Add new keywords to your lookup table, or
  • Manually assign a category for one-off transactions.

4. Forgetting to Update the Lookup Table

Your spending patterns change. New vendors appear. Old ones disappear. Review your lookup table quarterly and add keywords for any recurring transactions that keep landing in “Uncategorized.”

5. Mixing Personal and Business Transactions

If your bank account handles both personal and business transactions, add a “Personal” category to your lookup table. This way, personal expenses are clearly separated and will not inflate your business expense totals.

Going Further: Automating the Entire Workflow

The formula-based approach works well, but it assumes your bank statement data is already in Excel. For many freelancers and small business owners, that first step — getting the data out of a PDF bank statement and into a clean spreadsheet — is the real bottleneck.

Manually copying numbers from a PDF is tedious and error-prone. Copy-paste often mangles columns, merges cells unpredictably, and drops decimal points. And if you receive statements from multiple accounts, the problem multiplies.

This is where BankStatementLab fits into your workflow. Instead of manually extracting data, you can:

  1. Upload your bank statement PDF to BankStatementLab.
  2. Get clean, structured data with transactions already extracted into proper columns (date, description, amount).
  3. Download the result as CSV or Excel and open it directly in your spreadsheet.
  4. Apply your categorization formulas to the clean data using the methods described above.

By combining BankStatementLab for extraction with your Excel formulas for categorization, you create a streamlined pipeline that takes you from a raw PDF to a fully categorized, analysis-ready spreadsheet in minutes instead of hours.

The Combined Workflow

Here is what the full process looks like:

  1. Receive your bank statement (PDF).
  2. Upload to BankStatementLab for extraction.
  3. Download clean CSV/Excel file.
  4. Open in Excel — your lookup table and formulas are already set up.
  5. Categories populate automatically via INDEX/MATCH.
  6. Refresh your pivot table for an updated financial overview.
  7. Review any “Uncategorized” transactions and update your keyword list.

This seven-step workflow replaces what used to be a full afternoon of manual data entry and classification. Once your lookup table is mature (typically after two to three months of use), the vast majority of transactions will be categorized without any manual input.

Conclusion

Knowing how to auto categorize bank transactions in Excel is one of the highest-leverage skills a freelancer or small business owner can develop. It transforms a tedious monthly chore into a near-automatic process.

Start with the INDEX/MATCH + SEARCH formula approach. Build your keyword lookup table gradually. Use pivot tables to turn categorized data into actionable financial insights. And when the manual extraction of PDF statements becomes the bottleneck, let BankStatementLab handle the heavy lifting so you can focus on what you do best — running your business.

Ready to stop wrestling with PDF bank statements? BankStatementLab extracts your transaction data into clean, Excel-ready files 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