Function Problems

How to Perform a Partial VLOOKUP on Account Numbers in Excel

Olivia MillerOlivia Miller Nov 25, 2026 870 views

Question details

Find an account number or its associated value using the beginning of the account number as a partial lookup.

How to Perform a Partial VLOOKUP on Account Numbers in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
The user has partial account identifiers and needs to match them against a list containing letters, numbers, and underscores.
Observed behavior
A wildcard lookup should find the first account number that starts with the supplied text and return the account number or an associated value.
Before you start

Place the partial account number in A2 and the full account numbers in column C. For the VLOOKUP example, put the value you want to return in column D and ensure the account identifiers are stored as text.

Solution 1Recommended

Use VLOOKUP with a wildcard to find an account prefix

Use this method to return a value from column D when an account number in column C begins with the text in A2.

1
Enter the partial account number

Type the beginning of the account number in cell A2, including any underscores that are part of the identifier.

2
Enter the lookup formula

Select an empty cell and enter =IF(A2="","",IFERROR(VLOOKUP(A2&"*",C:D,2,FALSE),"Not found")). Press Enter.

3
Check the result

Compare the returned value with the first matching account in column C. Copy the formula down if you have more partial identifiers in column A.

Use VLOOKUP with a wildcard to find an account prefix
How the match works: The asterisk matches any characters after the prefix, while FALSE enables an exact pattern match. Underscores are treated as literal characters. If several accounts match, VLOOKUP returns the first one.
Work with account data in WPS

Find partial account numbers in WPS Spreadsheet

Use VLOOKUP with a wildcard in WPS Spreadsheet to find account prefixes and return associated values from your worksheet.

  1. 1. Open your spreadsheet: Open WPS Spreadsheet and select File > Open to choose your account workbook.
  2. 2. Arrange the lookup data: Enter the partial identifier in A2, the full account numbers in column C, and their associated values in column D.
  3. 3. Enter the formula: Select an empty cell and enter =IF(A2="","",IFERROR(VLOOKUP(A2&"*",C:D,2,FALSE),"Not found")). Press Enter.
  4. 4. Review and save: Check the returned value against the account list, then select File > Save to save the workbook.
Match account-number prefixes containing letters, numbers, and underscoresOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and controlsHandle missing matches with IFERROR
microsoft office alternative - wps office

Frequently Asked Questions

Does an underscore need a wildcard escape character?

No. An underscore is treated as a literal character in Excel wildcard lookups, so include it directly in the partial account number in A2.

Why does the formula return only one account when several match?

VLOOKUP and XLOOKUP return the first matching row by default. Check the order of the account numbers in column C if the returned value is not the one you expected.

Why does a partial account lookup return Not found?

Check that A2 contains the correct starting characters and that the account numbers in column C are stored as text. Also check for unwanted spaces in the lookup value or account list.

What if my account number contains an asterisk or question mark?

Excel treats * and ? as wildcard characters. Use a tilde before either character to match it literally; for example, ~* matches an actual asterisk.