Nov 16 2023 05:56 AM
I am trying to use XLOOKUP to find an identifying number from a separate spreadsheet, referenced by a different identifying number. My equation works for the most part, but I have a few #N/A errors (3 out of 11), but I have confirmed that the values were present in the array and that there were no typos.
I cannot share a screenshot, so I will give a simplified version using sheets WS1, WS2, and WS3 with values ID1 and ID2. WS1 is the active sheet I am writing the formula in
ID1 =VLOOKUP(A2,WS2,ID1Column,false (This equation works with no issues)
ID2 = XLOOKUP(ID1Value,WS2LookupArray,WS2ReturnArray)
ID2 equation works for the majority of the time, but returns a few #N/A and I cannot figure out why. I have run trim to eliminate any extra spaces, I formatted all cells the same way, I have no idea why I cannot get the error cells to work.
Nov 16 2023 07:37 AM
@jgans The LOOKUP functions are sensitive to the data-type on both ends. They will only find a match if both the looked for cell and the Looked In range contain numeric, or text values. If the data types do not match up, no match is found.
So check your data in the table you are looking up information from, some ID's are text and others are numbers. You want all of them to be text, or all of them numbers. And the cell containing the lookup ID to be of the same data type.
Nov 18 2023 08:05 AM
Excel gives you the clues if you know where to look for them.
One approach to determining why a lookup function like XLOOKUP is missing is to simplify and create a basic formula to compare contents of two cells:
In the first screen capture, =F1=G1 results in FALSE despite the contents appearing to be the same. In the next screen capture, each cell is evaluated with F9 to show you how Excel sees things.
Sep 11 2024 09:25 AM
I am having the exact same issue and I have verified using the =Cell=Cell that they are in fact indentical. This returns True. What else could it be?
Sep 11 2024 10:38 AM
Sep 11 2024 05:24 PM - edited Sep 12 2024 02:21 AM
As @Patrick2788 wrote, it behooves you to show us the formulas -- and the data as well.
Even better (since cell=cell has different results), attach an Excel file that demonstrates the problem. Click on "browse files to attach" at the bottom of the reply applet.
That said, I suspect that one or both cells are calculated, and their internal binary values differ infinitesimally.
The remedy might be: be sure that both cells are explicitly rounded to the same precision.
The difference might be invisible because Excel formats only up to 15 significant digits.
And the equal operator ( "=" ) compares values that are rounded to 15 significant digits internally just for the purpose of the comparison.
In contrast, lookup and match functions compare the full binary value, which is not limited 15 significant digits, contrary to most online documentation including MSFT's.
Example: