Convert Text Entries to Numbers with an Excel Lookup Table
Question details
Match text entries against a reference table and return the corresponding numerical values.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains text entries that need to be mapped to numbers in a lookup table.
- Observed behavior
- Numbers stored as text may prevent the lookup from returning usable numeric values.
Check that the reference table has one column for text entries and another for their corresponding numeric values. Confirm that the text entries match the reference entries and that the value column contains numbers rather than text.
Use XLOOKUP to return the matching numeric value
Use this method when XLOOKUP is available and your reference data is in an Excel table.
Make sure the Excel table is named LookupTable and has columns named Entry and Value. Enter the text to match in cell A2.
In the result cell, enter =XLOOKUP(A2,LookupTable[Entry],LookupTable[Value],"") and press Enter. The formula returns a blank when no match is found.
Drag the result cell's fill handle down to look up the remaining entries in column A.

Use VLOOKUP when XLOOKUP is unavailable
Use VLOOKUP for an exact match when the text entries are in the first column of the reference range.
Convert lookup values stored as text into numbers
Use Text to Columns on the reference table's value column if the lookup returns numeric-looking text.
Map Text Entries to Numbers in WPS Spreadsheets
Use VLOOKUP in WPS Spreadsheets to match each text entry to a numeric value in a reference table.
- 1. Open the workbook: Open WPS Spreadsheets and use Open to select your Excel workbook.
- 2. Prepare the reference table: Enter text entries in D2:D10 and their corresponding numeric values in E2:E10. Enter the text to match in A2.
- 3. Add the lookup formula: Select the result cell, enter =IFERROR(VLOOKUP(A2,$D$2:$E$10,2,FALSE),"") and press Enter.
- 4. Fill and save: Drag the result cell's fill handle down for other entries, then choose File > Save As to save the workbook.

Frequently Asked Questions
Why does my lookup return a number stored as text?
The corresponding value in the reference table may be stored as text. Select the source value cells and use Data > Text to Columns with General as the column data format to convert them.
Why is my lookup result blank?
The XLOOKUP example returns a blank when it finds no match. Check that the entry matches the reference text, including spaces. In the VLOOKUP example, remove IFERROR temporarily to see the underlying error.
Can I use VLOOKUP instead of XLOOKUP?
Yes. Place the lookup text in the first column of the reference range and the numeric values in a column to its right. Use VLOOKUP with FALSE as the last argument for an exact match.
Will changing a cell's format to Number convert text into a number?
Not necessarily. Changing the format affects display but may leave the stored value as text. Use Data > Text to Columns or set the cell to General and press F2 followed by Enter.




