ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Lookups
  3. VLOOKUP With Numbers Stored as Text

VLOOKUP With Numbers Stored as Text

By ExcelReady Team·Updated November 2, 2026·7 min read

The short answer

VLOOKUP treats the number 1003 and the text "1003" as different values, so an exact match returns #N/A when one side is a number stored as text. If the lookup value is text, wrap it in VALUE: =VLOOKUP(VALUE(E2),A2:C6,3,FALSE). If the table holds text, join an empty string: =VLOOKUP(E2&"",A2:C6,3,FALSE).

Key takeaways

  • To VLOOKUP, the number 1003 and the text "1003" are not the same, so an exact match fails with #N/A.
  • Check each side with ISNUMBER: TRUE means a real number, FALSE means text (or something else).
  • Lookup value is text, table has numbers: use VALUE(E2). Lookup value is a number, table has text: use E2&"".
  • For IDs with leading zeros, keep them as text and use TEXT(E2,"00000") to match.
  • The lasting fix is to convert the whole column to one type, so every formula works.
On this page+
  1. Why VLOOKUP fails with numbers stored as text
  2. How to tell which side is text
  3. Fix 1: The lookup value is text and the table has numbers
  4. Fix 2: The lookup value is a number and the table has text
  5. Fix 3: The column mixes numbers and text
  6. How to convert the whole column instead
  7. Does XLOOKUP have the same problem?
  8. Practise it

VLOOKUP returns #N/A when you look up a number stored as text in a column of real numbers, or the other way round. The cells look identical, but VLOOKUP compares the type as well as the digits. This guide shows how to find which side is text and how to fix it, either inside the formula with VALUE or &"", or once and for all in the data.

Why VLOOKUP fails with numbers stored as text#

VLOOKUP with an exact match only finds values of the same type, so the number 1003 never matches the text "1003". A number stored as text is a cell that shows digits but holds text. It often comes from a system export, a CSV file or a value typed with a leading apostrophe, like '1003.

Here is a small product list. The IDs in column A are real numbers. The ID typed in E2 was pasted from an email and is text.

ABCDE
1IDProductPriceFind ID
21001Desk2501003 (text)
31002Chair120
41003Lamp45
51004Shelf80
61005Monitor210

This formula looks right, but it returns #N/A:

Excel formula
=VLOOKUP(E2,A2:C6,3,FALSE)

The fourth argument, FALSE, asks for an exact match. Excel searches column A for the text "1003", finds only numbers, and gives up. The VLOOKUP function guide explains each argument if you need a refresher.

How to tell which side is text#

Test each cell with ISNUMBER before you change anything. It returns TRUE for a real number and FALSE for text.

CheckFormulaResult here
Is the lookup value a number?=ISNUMBER(E2)FALSE
Is the first ID a number?=ISNUMBER(A2)TRUE
How many IDs are real numbers?=COUNT(A2:A6)5

So the lookup value is the text side. You can also look for these visual clues:

  • Alignment. By default, numbers sit on the right of a cell and text sits on the left.
  • A green triangle in the top-left corner of the cell. Excel flags numbers stored as text this way, unless the check is turned off.
  • The status bar. Select the column. If it shows a Count but no Sum, the cells are text.

Formatting a cell as Number does not fix it. The format changes how a value is shown, not what it is. The article on numbers stored as text in Excel covers all the ways to spot them.

Fix 1: The lookup value is text and the table has numbers#

Wrap the lookup value in VALUE, which turns text that looks like a number into a real number:

Excel formula
=VLOOKUP(VALUE(E2),A2:C6,3,FALSE)

VALUE(E2) turns the text "1003" into the number 1003, so VLOOKUP finds row 4 and returns 45, the price of the Lamp. The VALUE function guide shows more examples.

Two shorter versions do the same job, because any maths on text digits makes Excel convert them:

Excel formula
=VLOOKUP(E2*1,A2:C6,3,FALSE)
=VLOOKUP(--E2,A2:C6,3,FALSE)

The double minus, --, turns the value negative and back again. All three return 45. VALUE is the easiest for someone else to read.

If the text also has a stray space, such as "1003 ", VALUE usually still works. If it returns #VALUE!, the cell holds something that isn't a digit, often a non-breaking space from a web page. Clean it first with VALUE(TRIM(SUBSTITUTE(E2,CHAR(160)," "))).

Fix 2: The lookup value is a number and the table has text#

Turn the number into text by joining it to an empty string with &"":

Excel formula
=VLOOKUP(E2&"",A2:C6,3,FALSE)

Say column A was imported as text and E2 holds the real number 1003. E2&"" gives the text "1003", which matches the text in column A, and the result is again 45.

When the IDs have leading zeros#

Codes like 00123 must stay as text, or Excel drops the zeros. If the table holds "00123" and the lookup cell holds the number 123, E2&"" gives "123" and still fails. Use TEXT to add the zeros back:

Excel formula
=VLOOKUP(TEXT(E2,"00000"),A2:C6,3,FALSE)

The format "00000" pads the number to five digits, so 123 becomes "00123". Match the number of zeros to the length of your codes.

Fix 3: The column mixes numbers and text#

When some IDs are numbers and some are text, try both versions with IFERROR:

Excel formula
=IFERROR(VLOOKUP(E2,A2:C6,3,FALSE),VLOOKUP(E2&"",A2:C6,3,FALSE))

The first VLOOKUP tries the value as it is. If that returns an error, the second tries it as text. If E2 itself might be text, use VALUE(E2) in one lookup and E2&"" in the other. This is a patch, though. A mixed column will cause trouble in SUM, COUNTIF and sorting too, so plan to clean it.

How to convert the whole column instead#

Fixing the data is better than fixing every formula. Convert the ID column to real numbers once, and every lookup works with a plain =VLOOKUP(E2,A2:C6,3,FALSE).

  1. Convert to Number. Select the cells with the green triangle, click the warning icon and choose Convert to Number.
  2. Text to Columns. Select the column, go to Data > Text to Columns and click Finish. Excel re-reads each cell as a number.
  3. Paste Special Multiply. Type 1 in a spare cell and copy it (Windows: Ctrl+C; Mac: ⌘C). Select the text numbers, open Paste Special (Windows: Ctrl+Alt+V; Mac: ⌃⌘V), choose Multiply and click OK.
  4. A helper column. In a new column, type =VALUE(A2), fill down, then paste the results back as values.

Text dates cause the same kind of mismatch when you look up by date. See how to convert text to dates for that case. If your lookup returns a value but the wrong one, the cause is different; the guide to VLOOKUP returning the wrong value walks through it.

Does XLOOKUP have the same problem?#

Yes. XLOOKUP, MATCH and XMATCH also treat 1003 and "1003" as different values, so the same fixes apply:

Excel formula
=XLOOKUP(VALUE(E2),A2:A6,C2:C6)

This returns 45. XLOOKUP needs Excel 2021 or Microsoft 365. Text numbers are only one reason a lookup fails. The checklist of why VLOOKUP is not working covers the other seven, and the article on the VLOOKUP column index number helps when the formula returns a value from the wrong column.

Practise it#

The fastest way to remember these fixes is to meet the error and fix it yourself. Practise fixing lookup errors in a live spreadsheet: you'll repair #N/A results caused by text numbers and spaces, and the sheet checks each answer instantly. Then practise TEXT and VALUE to convert numbers to text and back with confidence.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

The ID in E2 is stored as text, but the IDs in column A are real numbers. In F2, use VLOOKUP with VALUE to return the Price for that ID.

fx
ABCDEFG
1
ID
Product
Price
Find ID
Price
2
1001
Desk
250
1003
3
1002
Chair
120
4
1003
Lamp
45
5
1004
Shelf
80
6
1005
Monitor
210
7
8
9

Tip: Wrap E2 in VALUE so it becomes the number 1003, then look it up in A2:C6 and return column 3 with FALSE.

Practise this in a lesson

LessonFixing lookup errorsDiagnose #N/A, #REF! and silent wrong answers in lookups, then handle missing items gracefully.LessonTEXT and VALUE: numbers to text and backFormat dates and dollar amounts inside sentences with TEXT, and turn digits stored as text into real numbers with VALUE.Function guideVLOOKUPLearn VLOOKUP with clear examples, the 4 most common mistakes, and a live practice exercise you can try in your browser.Function guideVALUEFix numbers stored as text with Excel's VALUE function, so SUM and lookups work again. Examples, common mistakes and a live practice exercise.

Frequently asked questions

Why does VLOOKUP return #N/A when the number is clearly in the list?

+

Usually one side is a real number and the other is a number stored as text. They look the same but VLOOKUP sees two different values. Test both cells with ISNUMBER to find the text one.

How do I make VLOOKUP work with numbers stored as text?

+

Convert the lookup value to match the table. Use VALUE(E2) when the lookup value is text and the table has numbers, or E2&"" when the lookup value is a number and the table has text.

Does XLOOKUP have the same problem with text numbers?

+

Yes. XLOOKUP and MATCH also treat 1003 and "1003" as different values. The same fixes, VALUE or &"", work inside XLOOKUP.

How do I VLOOKUP an ID with leading zeros?

+

Keep the IDs as text so the zeros stay, then format the lookup value the same way with TEXT, for example =VLOOKUP(TEXT(E2,"00000"),A2:C6,3,FALSE) to find 00123 from the number 123.

Is it better to fix the formula or the data?

+

Fix the data when you can. Converting the whole column to numbers makes every lookup, SUM and sort work. Fix the formula when you can't change the source file, such as a daily export.

Sources

  • VLOOKUP function - Microsoft Support
  • VALUE function - Microsoft Support
  • Convert numbers stored as text to numbers - Microsoft Support

Written and checked by the ExcelReady Team. First published November 2, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. Why VLOOKUP fails with numbers stored as text
  2. How to tell which side is text
  3. Fix 1: The lookup value is text and the table has numbers
  4. Fix 2: The lookup value is a number and the table has text
  5. Fix 3: The column mixes numbers and text
  6. How to convert the whole column instead
  7. Does XLOOKUP have the same problem?
  8. Practise it

Keep reading

Errors & fixes· 6 min read

Numbers Stored as Text in Excel: Find and Fix

Numbers stored as text look like numbers but Excel treats them as words, so SUM skips them and lookups miss them. You can spot them by left alignment and a small green triangle. To fix them, select the cells, click the warning icon and choose Convert to Number, or use =VALUE(A2) in a helper column.

Lookups· 7 min read

VLOOKUP Column Index Number Explained

The column index number is VLOOKUP's third argument. It tells Excel which column of the table to return, counted from the left edge of the table you selected, not from column A. In =VLOOKUP(F2,A2:D6,4,FALSE), 4 means the fourth column of A2:D6, which is column D. A number too big gives #REF!.

Lookups· 6 min read

VLOOKUP Not Working? 8 Causes and Fixes

When VLOOKUP is not working, the usual causes are a missing FALSE for exact match, extra spaces, numbers stored as text, a lookup value that isn't in the first column, or a table range that shifts when copied. Check each one in turn. TRIM fixes spaces, $ signs lock the range, and IFNA handles values that are truly missing.

More on lookups

  • VLOOKUP Second Match: Return the Nth Occurrence in Excel
  • VLOOKUP Between Two Sheets, Step by Step
  • VLOOKUP With Wildcards: Partial Match Lookups
  • XLOOKUP in Excel: Everything a Beginner Needs
  • XLOOKUP From Another Sheet or Workbook
  • XLOOKUP Approximate Match: Next Smaller or Larger
All lookups articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free