Forum Discussion
RSGrayson
Jun 29, 2024Copper Contributor
XLOOKUP wildcard matching issue
Hello, I can't figure out why the XLOOKUP formula in the attached file is returning only 1 match when there should be 3. Any ideas?
- Jun 30, 2024
RSGrayson There were no wildcards used in your original formula. To return the first matching record that contains the lookup_value, you need to concatenate an asterisk ("*") to both the start and end of the lookup_value as follows:
=XLOOKUP("*" & [@[Medical Conditions]] & "*", VA_List[VA List of Disablities], VA_List[VA List of Disablities], "Not found", 2)
If further explanation is needed, please see: https://exceljet.net/formulas/xlookup-wildcard-match-example
haseebjadoon05
Oct 16, 2024Copper Contributor
Hi @OP! 👋
The issue might be due to wildcard matching behavior in XLOOKUP. Here are a few things to check:
Ensure correct wildcard usage:
Use * to match any number of characters and ? to match a single character.
Example: XLOOKUP("*search*", A2:A10, B2:B10)
Check for leading or trailing spaces:
Sometimes extra spaces in your data can prevent matches. You can use TRIM() on your lookup array to clean it up.
Verify data type compatibility:
Make sure both your lookup value and lookup range are formatted as text or the same data type.
I ran into a similar issue automating menu updates on Albaik Menu Website, https://menualbaik.com where I had to clean up raw data and match menu items using wildcards. If you'd like, I can help you troubleshoot further—just let me know!
The issue might be due to wildcard matching behavior in XLOOKUP. Here are a few things to check:
Ensure correct wildcard usage:
Use * to match any number of characters and ? to match a single character.
Example: XLOOKUP("*search*", A2:A10, B2:B10)
Check for leading or trailing spaces:
Sometimes extra spaces in your data can prevent matches. You can use TRIM() on your lookup array to clean it up.
Verify data type compatibility:
Make sure both your lookup value and lookup range are formatted as text or the same data type.
I ran into a similar issue automating menu updates on Albaik Menu Website, https://menualbaik.com where I had to clean up raw data and match menu items using wildcards. If you'd like, I can help you troubleshoot further—just let me know!