Formula Errors

Fix Excel VLOOKUP #N/A Errors When Matching Phone Area Codes

Nimra MalikNimra Malik Nov 25, 2026 869 views

Question details

Match an area code extracted from a phone number to a lookup table without a VLOOKUP #N/A error caused by mismatched data types.

Fix Excel VLOOKUP #N/A Errors for Phone Area Codes
Product
Microsoft Excel
Device & OS
not provided
Scenario
A formula extracts the first three characters of a phone number and looks them up in a table whose area codes are stored as numbers.
Observed behavior
VLOOKUP may return #N/A because LEFT returns text while the lookup table contains numeric area codes.
Before you start

Check that the phone number in A1 begins with a three-digit area code and that the first column of the lookup table contains numeric codes. The example also assumes the table has a second column containing the value you want to return.

Solution 1Recommended

Convert the extracted area code to a number in Excel

Use this formula when the lookup table stores area codes as numbers.

1
Select the result cell

Open the worksheet in Excel and select the cell where you want the lookup result to appear.

2
Enter the VLOOKUP formula

Type =VLOOKUP(LEFT(A1,3)+0,LookupTable,2,FALSE), replacing A1 with the phone number cell and LookupTable with your named range or table range.

3
Check the result

Press Enter. If #N/A remains, check that the numeric area code exists in the first column of the lookup range and that the range includes the return column.

Convert the extracted area code to a number in Excel
How the conversion works: LEFT returns text, and adding 0 converts a numeric text result to a number. This conversion removes leading zeros, so use consistent text values instead if leading zeros must be preserved.
Work with formulas in WPS Spreadsheets

Fix the area code lookup in WPS Spreadsheets

Open your workbook in WPS Spreadsheets and convert the extracted area code to a number inside VLOOKUP so it can match a numeric lookup column.

  1. 1. Open the workbook: Launch WPS Spreadsheets and use Open to select your Excel workbook.
  2. 2. Check the lookup range: Find the lookup table and confirm that its first column contains numeric area codes and its second column contains the values to return.
  3. 3. Enter the formula: Select the result cell and enter =VLOOKUP(LEFT(A1,3)+0,LookupTable,2,FALSE), replacing A1 and LookupTable with your cell and lookup range.
  4. 4. Verify the match: Press Enter and check the result. If it shows #N/A, confirm that the extracted code is present in the first column of the lookup range.
Match extracted area codes against numeric lookup valuesOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and menus
microsoft office alternative - wps office

Frequently Asked Questions

Why does VLOOKUP return #N/A when the area code is in the table?

LEFT returns the extracted characters as text, which may not match a numeric code in the lookup table. Add +0 after LEFT, as in =VLOOKUP(LEFT(A1,3)+0,LookupTable,2,FALSE).

What if the phone number starts with a parenthesis or country code?

LEFT(A1,3) will not extract the intended area code in that case. Adjust the extraction formula to return the three area code digits before using them in VLOOKUP.

How can I preserve leading zeros in an area code?

Store the lookup codes as text and use =VLOOKUP(LEFT(A1,3),LookupTable,2,FALSE). Ensure the first column contains matching three-character text values, including any leading zeros.

What does FALSE do in the VLOOKUP formula?

FALSE requests an exact match. VLOOKUP returns #N/A if it cannot find the converted area code in the first column of the lookup range.