Function Problems

How to Categorize Bank Transactions by Partial Text in Excel

Chanuka GeekiyanageChanuka Geekiyanage Oct 28, 2026 869 views

Question details

The user needs to group imported bank transactions by matching partial text in the descriptions to a standardized set of categories for easier tax reporting.

How to Categorize Bank Transactions by Partial Text in Excel
Product
Excel
Device & OS
not provided
Scenario
Preparing financial data for tax reporting by filtering, sorting, or summarizing transaction categories.
Observed behavior
Bank transactions have varied descriptions (e.g., 'gas January', 'gas March') that require a formula to automatically extract a shared keyword ('gas') and assign a unified category.
Before you start

Ensure your bank transactions are imported into an Excel worksheet and compile a list of the unique category keywords (like 'gas', 'hire', etc.) that you want the formula to look for.

Solution 1Recommended

Use INDEX and SEARCH Formulas to Categorize Transactions

Extract partial text matches from transaction descriptions and assign them to a predefined list of categories using a combined array formula.

This method utilizes the SEARCH function to scan for specific keywords within your transaction descriptions. By combining it with ISNUMBER, MATCH, and INDEX, Excel automatically compares the description against your keyword list and returns the correct category.

1
Create a keyword category list

In a blank area of your worksheet (for example, cells G2:G4), type the unique categories or keywords you want to find, such as 'gas' and 'hire'.

2
Add a Category column

Insert a new column next to your transaction descriptions (e.g., Column E) to hold the extracted categories.

3
Enter the combination formula

In the first cell of your new Category column (e.g., E2), enter the formula: =INDEX($G$2:$G$4,MATCH(TRUE,ISNUMBER(SEARCH($G$2:$G$4,C2)),0)). This assumes C2 contains your transaction description.

4
Apply the formula to all rows

Press Enter, then click and drag the fill handle (the small square at the bottom-right corner of the cell) down to apply this formula to all your imported bank transactions.

5
Summarize your categorized data

Once the categories are extracted, use this new column to easily sort the rows, apply data filters, or insert a PivotTable for your tax reporting.

Use INDEX and SEARCH Formulas to Categorize Transactions
Array Formula Requirement: Depending on your version of Excel, you might need to press Ctrl + Shift + Enter instead of just Enter to properly apply this formula as an array.
Categorize Data Easily with WPS Office

Use WPS Spreadsheet to Seamlessly Categorize Bank Transactions

WPS Spreadsheet fully supports advanced array formulas like INDEX and SEARCH, allowing you to categorize, filter, and summarize your financial records efficiently. It provides a lightweight and free environment for all your tax preparation and data analysis tasks.

  1. 1. Open your transaction data: Launch WPS Spreadsheet and open the file containing your imported bank transactions.
  2. 2. Set up your categories: List your target keywords in a separate column range, just as you would in Microsoft Excel.
  3. 3. Apply the formula: Type the exact same =INDEX($G$2:$G$4,MATCH(TRUE,ISNUMBER(SEARCH($G$2:$G$4,C2)),0)) formula to extract categories from the descriptions.
  4. 4. Create a PivotTable: Navigate to the Insert tab and select PivotTable to organize and summarize your newly categorized financial data.
Fully compatible with Microsoft Excel formulas and .xlsx document formats.Lightweight and fast, ideal for handling large bank transaction exports without lagging.Features built-in PivotTable and filtering tools to quickly summarize categorized tax data.Free to download and use with a highly familiar user interface.
microsoft office alternative - wps office

Frequently Asked Questions

What if a transaction description does not contain any of my listed keywords?

If no match is found, the formula will return an #N/A error. You can wrap your formula in an IFERROR function, such as =IFERROR(INDEX(...), "Uncategorized"), to automatically assign a default category for unmatched items.

Does the SEARCH function distinguish between uppercase and lowercase letters?

No, the SEARCH function is case-insensitive, meaning it will treat 'GAS' and 'gas' equally. If you require a case-sensitive match, replace SEARCH with the FIND function in your formula.

Can I use this method to categorize expenses in a PivotTable directly?

You cannot perform this array extraction natively inside the PivotTable. You must first create a helper column using the INDEX and SEARCH formula to extract the categories. Once populated, you can then add this new column to your PivotTable as a row or filter.