Function Problems

How to Fix VLOOKUP Returning #N/A for Very Long Text Values

Steve KSteve K Oct 23, 2026 869 views

Question details

Users are encountering #N/A errors when trying to use VLOOKUP on data containing very long text strings, although the function works perfectly for shorter strings.

How to Fix VLOOKUP Returning #N/A for Very Long Text Values
Product
Microsoft Excel
Device & OS
not provided
Scenario
Pulling data such as long part numbers or detailed descriptions from another workbook using the VLOOKUP function.
Observed behavior
The VLOOKUP function returns an #N/A error for specific cells containing extremely long text values, failing to match strings that actually exist in the source data.
Before you start

Verify the exact character length of your lookup text using the =LEN() formula, as standard Excel lookup functions cannot process strings exceeding 255 characters.

Solution 1Recommended

Use Power Query to Merge Data

Power Query is the most reliable method for bypassing the 255-character limit, allowing you to join tables based on long text strings without formula errors.

Instead of relying on standard worksheet formulas, Power Query treats your workbooks as databases. This eliminates the character length restrictions inherent to VLOOKUP and MATCH functions.

1
Import the Data

Go to the Data tab on the Excel ribbon, click 'Get Data', and select 'From File' > 'From Workbook' to load both your primary table and the source data table into Power Query.

2
Merge the Queries

In the Power Query Editor, go to the Home tab and click 'Merge Queries'. Select your first table, then choose the second table from the dropdown menu.

3
Select Matching Columns

Click the column containing your long text values in the top table, then click the corresponding column in the bottom table to define the relationship, and click OK.

4
Expand and Load

Click the expand icon (two diverging arrows) on the newly merged column header to select the specific data fields you want to bring over. Finally, click 'Close & Load' to return the merged data to your worksheet.

Use Power Query to Merge Data

Handle Complex Data Lookups Effortlessly in WPS Spreadsheet

WPS Office offers a robust Spreadsheet application that perfectly handles advanced array formulas like INDEX and MATCH, allowing you to bypass traditional lookup limitations. It seamlessly opens Microsoft Excel files and ensures your large datasets run smoothly without heavy lag.

  1. 1. Open Your Workbook: Launch WPS Spreadsheet and open the workbook containing your long text lookup values.
  2. 2. Apply the Array Formula: Select your target cell and input the advanced formula: =INDEX(Return_Range, MATCH(TRUE, INDEX(Lookup_Range=Lookup_Value, 0), 0)).
  3. 3. Calculate Instantly: Press Enter. WPS Spreadsheet will instantly process the boolean array comparison, returning your matching data regardless of the 255-character restriction.
Fully compatible with Microsoft Excel (.xlsx) formats and standard functionsSupports complex array formulas to process long text strings effortlesslyLightweight architecture ensures fast calculation on large datasetsFree to use with an intuitive, tabbed user interface
microsoft office alternative - wps office

Frequently Asked Questions

What is the maximum character limit for VLOOKUP?

The VLOOKUP function has a hard limit of 255 characters for the lookup_value argument. If the text string being searched is 256 characters or longer, it will trigger a #VALUE! or #N/A error.

Does XLOOKUP fix the 255-character limit?

No, standard XLOOKUP and standard MATCH functions both share the same 255-character limitation for exact text matching. You must still rely on Power Query or array-based formulas (like the MATCH(TRUE...) workaround) to handle longer text strings.

Why does my VLOOKUP return #N/A when the text length is under 255 characters?

If your text is under the character limit but still returns #N/A, the issue is likely due to formatting mismatches, trailing spaces, or hidden non-printing characters. Using the TRIM and CLEAN functions on both data sets usually resolves this.

How can I quickly check the length of my text string?

You can use the LEN function. Type =LEN(A1) in an adjacent cell to instantly see the exact character count of the text inside cell A1.