A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Hello @Tom Hasler,
Thanks for sharing the details, this is a common scenario with ZIP code lookups, and you’re very close. The #N/A you’re seeing is most likely caused by how the XLOOKUP formula is structured and how Excel is interpreting the data types.
Here’s how to resolve it step by step:
Step 1: Correct the XLOOKUP structure
Your current formula is:
=XLOOKUP(LEFT(Q19,5),TAXRATES_ZIP5_KY202605!B:D,3,FALSE)
This syntax is valid for VLOOKUP, but not for XLOOKUP. XLOOKUP requires:
- One column for the lookup array
- One column for the return array (not a column index)
Update the formula to:
=XLOOKUP(LEFT(Q19,5), TAXRATES_ZIP5_KY202605!B:B, TAXRATES_ZIP5_KY202605!D:D)
This tells Excel to:
- Look for the first 5 digits of the ZIP code in column B
- Return the matching tax rate from column D
Step 2: Ensure both sides use the same data type
Even if the ZIP codes look identical, Excel may treat one as text and the other as a number or other format. In that case, XLOOKUP will not match them and will return #N/A.
To avoid this, you can force both values to the same type. If your ZIP codes are stored as text (which is common), update the formula to:
=XLOOKUP(TEXT(LEFT(Q19,5),"00000"), TEXT(TAXRATES_ZIP5_KY202605!B:B,"00000"),TAXRATES_ZIP5_KY202605!D:D)
This ensures both the lookup value and the lookup column are treated consistently as 5-digit text. Once both are corrected, the formula should return the expected result.
If you’re still seeing the issue after these steps, feel free to share a sample row from your sheet and I can help pinpoint it further.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.