How to Fix VLOOKUP Returning #N/A for Very Long Text Values
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.

- 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.
Verify the exact character length of your lookup text using the =LEN() formula, as standard Excel lookup functions cannot process strings exceeding 255 characters.
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.
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.
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.
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.
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 an INDEX and MATCH Array Formula
If you prefer to resolve the issue directly on the worksheet without using Power Query, a specific INDEX and MATCH array combination can evaluate strings longer than 255 characters.
Clean Data for Hidden Characters
Sometimes VLOOKUP fails not because the string exceeds 255 characters, but because long text strings imported from other systems contain invisible line breaks or trailing spaces.
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. Open Your Workbook: Launch WPS Spreadsheet and open the workbook containing your long text lookup values.
- 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. Calculate Instantly: Press Enter. WPS Spreadsheet will instantly process the boolean array comparison, returning your matching data regardless of the 255-character restriction.

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.




