Function Problems

Convert Text Entries to Numbers with an Excel Lookup Table

Chanuka GeekiyanageChanuka Geekiyanage Dec 2, 2026 869 views

Question details

Match text entries against a reference table and return the corresponding numerical values.

Convert Text Entries to Numbers with an Excel Lookup Table
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.
Before you start

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.

Solution 1Recommended

Use XLOOKUP to return the matching numeric value

Use this method when XLOOKUP is available and your reference data is in an Excel table.

1
Check the lookup table

Make sure the Excel table is named LookupTable and has columns named Entry and Value. Enter the text to match in cell A2.

2
Enter the formula

In the result cell, enter =XLOOKUP(A2,LookupTable[Entry],LookupTable[Value],"") and press Enter. The formula returns a blank when no match is found.

3
Apply it to other rows

Drag the result cell's fill handle down to look up the remaining entries in column A.

Use XLOOKUP to return the matching numeric value
Check the returned value: XLOOKUP returns the value as stored in the reference table. If the result is a number stored as text, convert the source values to numbers using the method below.
Work with lookup tables in WPS

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. 1. Open the workbook: Open WPS Spreadsheets and use Open to select your Excel workbook.
  2. 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. 3. Add the lookup formula: Select the result cell, enter =IFERROR(VLOOKUP(A2,$D$2:$E$10,2,FALSE),"") and press Enter.
  4. 4. Fill and save: Drag the result cell's fill handle down for other entries, then choose File > Save As to save the workbook.
Match text entries to numeric values with an exact lookupOpen and edit Microsoft Excel XLSX and XLS filesUse a familiar spreadsheet interface to review formulas and reference data
QA img-9

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.