VLOOKUP on Numbers: Fix Errors & Use Numeric Lookups

Errors & fixes · Updated November 23, 2026

Yes, VLOOKUP works on numbers, but Excel treats numbers and text differently, so a lookup value that looks like a number can fail if the data types don’t match. The most common fix is to use =VLOOKUP(B2, A:C, 3, FALSE) with the lookup value as a number, but if you get #N/A, check whether the lookup column contains numbers stored as text. This article explains how to make VLOOKUP work reliably with numeric data, including formatting fixes, wildcard workarounds, and when to switch to XLOOKUP.

How VLOOKUP Handles Numbers

VLOOKUP matches the lookup value against the first column of your table array. When both are true numbers, Excel compares them numerically, so =VLOOKUP(100, A2:B10, 2, FALSE) finds the row where column A equals the number 100. The fourth argument (range_lookup) should be FALSE for exact matches, which is what you almost always want with numbers. If you use TRUE or omit it, VLOOKUP performs an approximate match and requires the first column to be sorted ascending; otherwise, you get unpredictable results.

The problem arises when the lookup value is a number but the first column contains numbers stored as text (often indicated by a green triangle in the cell or left-aligned by default). Excel then tries to match a number to a text string, and even though they look identical, the match fails and returns #N/A. Conversely, if your lookup value is text (e.g., from a cell formatted as text) and the table has real numbers, the same mismatch occurs.

Why Numbers Stored as Text Break VLOOKUP

Excel stores numbers as numeric values (doubles) and text as strings. When you type a number into a cell, it’s numeric by default. But numbers can become text when you import data from a CSV, copy from a web page, or apply the Text format before entering. A common sign: the cell is left-aligned (numbers are right-aligned by default) and has a small green triangle warning. Even if you don’t see the triangle, the data type is still text.

VLOOKUP does not coerce types automatically. It compares the raw values, so a number 100 and the text “100” are not equal. This is a frequent source of frustration because the values look identical on screen. To check, use the ISTEXT function: =ISTEXT(A2) returns TRUE if A2 is text. Or select the column and look at the Number Format in the Home tab—if it says Text, that’s a clue.

How to Fix #N/A When Lookup Values Are Numbers

Here are the most reliable ways to fix a VLOOKUP that fails on numbers:

  • Convert the lookup column to numbers: Select the column, go to Home > Number, and change format to General or Number. Then use the error warning (if present) and choose “Convert to Number.” Or use Text to Columns: select the column, Data > Text to Columns, click Finish (no delimiters needed) to force conversion.
  • Use a formula to convert the lookup value: If you can’t change the table, wrap the lookup value in VALUE(): =VLOOKUP(VALUE(B2), A:C, 3, FALSE). This turns text that looks like a number into a real number.
  • Convert the table column with an array formula: In a helper column, use =VALUE(A2) and drag down, then VLOOKUP against that helper column. This is useful when the table is imported and you don’t want to alter the original data.
  • Use a wildcard trick for text lookups: If your lookup value is text and the table has numbers, you can force text comparison by concatenating an asterisk: =VLOOKUP("*"&B2&"*", A:C, 3, FALSE). This works because VLOOKUP treats the lookup value as text when it contains a wildcard. But it only works if the lookup value is text; if B2 is a number, the asterisk won’t help.

After any fix, test with a simple case. For example, with numbers in A2:A10 and lookup value 5 in B2, =VLOOKUP(B2, A2:C10, 3, FALSE) returns the corresponding value from column C. If it returns #N/A, check the data types.

Using VLOOKUP with Numeric Ranges (Approximate Match)

VLOOKUP can also look up numbers in ranges, like tax brackets or discount tiers, using approximate match. Set the fourth argument to TRUE or omit it, and sort the first column in ascending order. For example, to find a tax rate based on income in B2, with thresholds in A2:A5 and rates in B2:B5, use =VLOOKUP(B2, A2:B5, 2, TRUE). This returns the rate for the largest threshold that is less than or equal to the lookup value. This is a common use case for numeric data, and it works because VLOOKUP assumes the first column is sorted.

Be careful: if the first column is not sorted, approximate match can return incorrect results. Also, if the lookup value is smaller than the first threshold, VLOOKUP returns #N/A. For example, with thresholds 0, 10000, 20000, a lookup of 5000 returns the rate for 0, but a lookup of -1 returns #N/A.

Comparing VLOOKUP with XLOOKUP and INDEX/MATCH for Numbers

XLOOKUP, available in Excel 2021 and Microsoft 365, is more robust for numbers because it handles data types more flexibly and doesn’t require sorting for approximate matches. For example, =XLOOKUP(B2, A:A, C:C) finds an exact match by default, and it can return the closest match with the match_mode argument. XLOOKUP also allows you to specify a value if not found, like =XLOOKUP(B2, A:A, C:C, "Not found"). This avoids the #N/A error entirely.

INDEX/MATCH is an older alternative that also works with numbers: =INDEX(C:C, MATCH(B2, A:A, 0)). The MATCH function with 0 for exact match handles numbers and text similarly to VLOOKUP, but you have more control over the lookup column and can look to the left. For numeric ranges, MATCH with 1 or -1 gives approximate matches. However, XLOOKUP is simpler and more powerful, so if you have Microsoft 365, it’s often the better choice.

Common Mistakes and How to Avoid Them

Here are frequent pitfalls when using VLOOKUP with numbers:

  • Forgetting the FALSE argument: If you omit it, VLOOKUP uses approximate match, which can return a wrong number instead of #N/A. Always use FALSE for exact matches.
  • Mixing data types: As explained, text vs. number mismatches cause #N/A. Always verify data types.
  • Leading/trailing spaces: A number stored as text may have invisible spaces, e.g., “100 “. Use TRIM() on the lookup value or the table column: =VLOOKUP(TRIM(B2), A:C, 3, FALSE).
  • Decimal precision: Floating-point numbers can cause mismatches if you compare to a rounded value. For example, 0.1 + 0.2 is not exactly 0.3 in Excel. Use ROUND() on both sides: =VLOOKUP(ROUND(B2,2), A:C, 3, FALSE).
  • Hidden characters from imports: Non-breaking spaces or line breaks can break matches. Use CLEAN() and TRIM().

Frequently Asked Questions

Why does VLOOKUP return #N/A even though the numbers look the same?
This almost always means the lookup value and the table column have different data types—one is a number, the other is text. Check with ISTEXT or look for the green triangle. Convert the text to numbers using the methods above.

Can I use VLOOKUP with numbers that have commas or currency symbols?
Yes, if the numbers are formatted with number formats (like $#,##0), they are still numeric. But if they are text with symbols (e.g., “$1,000”), VLOOKUP won’t match a plain number. You’d need to strip the symbols or use a helper column with =VALUE(SUBSTITUTE(A2,"$","")).

Does VLOOKUP work with negative numbers?
Yes, negative numbers work fine, as long as the data types match. For approximate match, ensure the first column is sorted ascending, including negatives.

What’s the difference between VLOOKUP and XLOOKUP for numeric lookups?
XLOOKUP is more flexible: it doesn’t require sorting for approximate matches, can search from bottom to top, and has a built-in not-found argument. It also handles data types more gracefully in some cases, but still requires matching types for exact matches.

How do I fix VLOOKUP when the lookup value is a formula that returns a number?
If the formula returns a number, it should work. But if the formula returns text (e.g., using TEXT() function), it will be text. Use VALUE() to convert the result, or change the formula to return a number.

Can VLOOKUP match numbers that are stored as text in the lookup column but the lookup value is a number?
No, not directly. You must convert one side. Either convert the lookup column to numbers, or use =VLOOKUP(TEXT(B2,"0"), A:C, 3, FALSE) to convert the lookup value to text. But this is fragile; better to fix the data.

Alternatives to VLOOKUP for Numeric Data

If you frequently work with numeric lookups, consider these alternatives:

  • XLOOKUP: The modern replacement, with better error handling and flexibility.
  • INDEX/MATCH: Works in all Excel versions and allows left lookups.
  • SUMIFS or SUMPRODUCT: For summing values based on numeric criteria, not just returning a single value.
  • Power Query: For cleaning imported data where numbers are stored as text, you can transform the column to number type before loading.

For most users, the simplest fix is to ensure your data is clean: convert text to numbers, remove spaces, and use FALSE for exact matches. If you have Microsoft 365, switching to XLOOKUP will save you time and frustration.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Errors & fixes

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.