Function Problems

Use INDEX MATCH and SEARCH for Partial Transaction Matches in Excel

Rana GarciaRana Garcia Nov 12, 2026 869 views

Question details

Find a category or subcategory when a transaction description contains, rather than exactly equals, a lookup term.

Use INDEX MATCH and SEARCH for Partial Transaction Matches in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
The user is categorizing transactions with vendor names or transfer descriptions that include prefixes, suffixes, store numbers, or other extra text.
Observed behavior
An exact XLOOKUP does not return a match when the lookup text is only part of the transaction description.
Before you start

Create a lookup table with a Transaction column containing the text to find and Category and SubCategory columns containing the values to return. Place more specific lookup terms above broader terms, because the formula returns the first matching row.

Solution 1Recommended

Use INDEX, MATCH, and SEARCH to return the first partial transaction match

Use this method when the transaction description includes a lookup phrase plus additional characters, such as a store number or payment reference.

SEARCH checks whether each lookup term appears anywhere within the current transaction description. MATCH identifies the first TRUE result, and INDEX returns the category from that matching row.

1
Prepare the lookup table

In the Lookup_Table, add columns named Transaction, Category, and SubCategory. Sort the Transaction terms from most specific to most general, for example, place "Amazon Marketplace" above "Amazon".

2
Enter the category formula

In the Category cell for the transaction row, enter =IFNA(INDEX(Lookup_Table[Category],MATCH(TRUE,ISNUMBER(SEARCH(Lookup_Table[Transaction],[@Transaction])),0)),"Add to lookup"). This searches each Lookup_Table[Transaction] value within the current row's [@Transaction] description.

3
Enter the subcategory formula

In the SubCategory cell, enter =IFNA(INDEX(Lookup_Table[SubCategory],MATCH(TRUE,ISNUMBER(SEARCH(Lookup_Table[Transaction],[@Transaction])),0)),"Add to lookup").

4
Confirm and fill the formulas

Press Enter to confirm the formula. In older spreadsheet versions that do not evaluate the array automatically, confirm it with Ctrl+Shift+Enter, then use the fill handle to copy the formula down.

Use INDEX, MATCH, and SEARCH to return the first partial transaction match
First matching term is returned: If several lookup terms appear in one transaction description, the formula returns the category from the first matching row in Lookup_Table.
WPS Spreadsheet formula tools

Categorize Partial Transaction Matches with WPS Spreadsheet

WPS Spreadsheet can use INDEX, MATCH, SEARCH, and IFNA formulas to identify a lookup phrase inside a longer transaction description and return the appropriate category or subcategory.

  1. 1. Open the transaction workbook: Open your .xlsx or .xls file in WPS Spreadsheet and select the worksheet containing transactions and the lookup table.
  2. 2. Add lookup columns: Create Transaction, Category, and SubCategory columns in the lookup range, then place the most specific search phrases at the top.
  3. 3. Insert the category formula: Select the Category result cell and enter the INDEX, MATCH, SEARCH, and IFNA formula using your lookup-table columns.
  4. 4. Add the subcategory formula: Select the SubCategory result cell, use the same formula pattern with the SubCategory return column, and press Enter.
  5. 5. Fill results down: Drag the fill handle down to apply both formulas to the remaining transaction rows.
Match vendor names even when transaction descriptions contain store numbers or transfer references.Control overlapping matches by ordering specific lookup terms before general terms.Open and edit Microsoft Excel .xlsx and .xls transaction workbooks.Use a familiar spreadsheet interface for formulas, tables, and fill-down calculations.
microsoft office alternative - wps office

Frequently Asked Questions

Why does XLOOKUP fail to categorize my transaction descriptions?

A standard XLOOKUP looks for an exact value unless you use wildcard logic. When the transaction contains extra text, use SEARCH inside INDEX and MATCH to test whether a lookup term appears within the full description.

How do I return a subcategory from the same partial-text match?

Use the same MATCH(TRUE,ISNUMBER(SEARCH(...)),0) portion and change the INDEX return range to Lookup_Table[SubCategory]. This keeps the category and subcategory tied to the same lookup row.

What happens if two lookup terms match one transaction?

INDEX and MATCH return the first matching lookup row. Order the lookup table with longer or more specific terms first, such as placing "Uber Eats" above "Uber".

How can I show a message when no transaction term is found?

Wrap the formula in IFNA, such as =IFNA(your_formula,"Add to lookup"). The message identifies transactions that need a new lookup term.

Does SEARCH distinguish between uppercase and lowercase text?

No. SEARCH is not case-sensitive, so it can match vendor names regardless of capitalization. Use FIND instead if a case-sensitive match is required.