How to Perform a Partial VLOOKUP on Account Numbers in Excel
Question details
Find an account number or its associated value using the beginning of the account number as a partial lookup.

- 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.
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.
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.
Type the beginning of the account number in cell A2, including any underscores that are part of the identifier.
Select an empty cell and enter =IF(A2="","",IFERROR(VLOOKUP(A2&"*",C:D,2,FALSE),"Not found")). Press Enter.
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 XLOOKUP to return the matching account number
Use XLOOKUP in a supported Excel version when you want to return the full matching account number from column C.
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. Open your spreadsheet: Open WPS Spreadsheet and select File > Open to choose your account workbook.
- 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. Enter the formula: Select an empty cell and enter =IF(A2="","",IFERROR(VLOOKUP(A2&"*",C:D,2,FALSE),"Not found")). Press Enter.
- 4. Review and save: Check the returned value against the account list, then select File > Save to save the workbook.

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.




