How to Fix XLOOKUP Not Finding URLs After Power Query Decoding
Question details
Users need to fix XLOOKUP failing to match URL strings after processing them through Power Query due to hidden character discrepancies.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Attempting to look up URLs with XLOOKUP after decoding UTF-8 characters like %20 and %C2%A0 in Power Query.
- Observed behavior
- XLOOKUP returns a 'Not Found' error because visually identical URLs contain hidden characters, non-breaking spaces, or different Unicode representations.
Ensure your source data is refreshed and verify the exact length of your lookup values using the LEN function to confirm if hidden characters exist.
Normalize Text and Remove Hidden Characters in Power Query
Clean and trim the URL text in Power Query to ensure non-breaking spaces and hidden characters are removed before passing data to XLOOKUP.
Visually identical URLs often fail in XLOOKUP because of non-breaking spaces or hidden control characters left behind after URL decoding. Normalizing the text ensures an exact match.
Select your data table in Excel, navigate to the Data tab on the ribbon, and click 'From Table/Range' to open the Power Query Editor.
Select the column containing your URLs. Go to the Transform tab, click 'Format', and choose 'Trim' to remove leading/trailing spaces, then click 'Format' again and choose 'Clean' to remove non-printable characters.
With the column still selected, click 'Replace Values' on the Transform tab. In the 'Value To Find' box, enter '#(00A0)' (the Power Query code for a non-breaking space). In the 'Replace With' box, enter a regular space, then click OK.
Click 'Close & Load' on the Home tab to return the cleaned data to your Excel worksheet. Run your XLOOKUP function again to verify the URLs are now matching correctly.

Use List.Accumulate for Bulk URL Decoding
Use a custom Power Query script with List.Accumulate to batch replace multiple UTF-8 encoded sequences consistently.
Try WPS Office for Seamless Data Lookup and Analysis
If you frequently encounter data formatting issues or need a lightweight, powerful spreadsheet tool, WPS Office is an excellent choice. It offers full compatibility with Microsoft Excel formats and supports advanced functions like XLOOKUP.

Frequently Asked Questions
Why do visually identical URLs fail in XLOOKUP?
Visually identical URLs may contain hidden characters, non-breaking spaces (like %C2%A0), or trailing spaces that are not visible to the naked eye. XLOOKUP requires an exact match, so these hidden differences cause the function to return a 'Not Found' error.
How can I check if my URLs have hidden characters?
You can use the LEN function in Excel (e.g., =LEN(A2)) to compare the character count of the lookup value and the array value. If the lengths differ despite looking the same, hidden characters or extra spaces are present.
What is the difference between Text.Trim and Text.Clean in Power Query?
Text.Trim removes leading and trailing spaces from a text string, while Text.Clean removes non-printable control characters (like line breaks or tabs). Using both ensures your text is properly normalized for lookup functions.
Can I decode URLs directly in Excel without Power Query?
Yes, you can use the SUBSTITUTE function in Excel to manually replace specific encoded characters (like replacing '%20' with a space). However, for large datasets with multiple different encodings, Power Query is much more efficient.




