Forum Discussion
kgilberg
Jun 27, 2022Copper Contributor
Vlookup not working in large file
I am doing a vlookup comparing two large files (200,000+ rows). The data I'm doing to vlookup on are in the number format. The vlookup will return approximately 2/3 of the data, but the other 1/3 sho...
JoeUser2004
Jun 27, 2022Bronze Contributor
kgilberg wrote: ``Any tips or tricks for things to test?``
You don't give us much to work with -- not even the formula(!).
First, the format of the cells do not matter. What matters is the type of the lookup value (first parameter) and type of the values in the lookup column.
Looks can be deceiving. Use formulas of the form =ISNUMBER(A1) to confirm that all data are truly numeric.
-----
Second, are you using VLOOKUP(..., FALSE) for an exact match or VLOOKUP(..., TRUE) for an approximate match?
(PS.... You answered that question in a response posted while I was writing.)
For VLOOKUP(..., TRUE), are the numerical values in ascending order?
For VLOOKUP(..., FALSE), are the internal binary values exactly equal?
A simple test like X1=Y1 is not sufficient because Excel rounds internally to 15 significant digits for comparison operators.
So, that might result in TRUE, but in fact, MATCH(X1, Y1, 0) might result in #N/A, which indicates that the binary values in fact do not match.
You might need to round all values to the precision that you expect to be accurate. Again, looks can be deceiving because Excel formats only up to 15 significant digits.
For example, 12.48 - 11.25 appears to be 1.23, even when formatted with 14 decimal places. But MATCH(12.48 - 11.25, {1.23}, 0) returns #N/A, indicating that the binary values are not the same.
kgilberg
Jun 27, 2022Copper Contributor
It's just a basic vlookup, nothing special or advanced about it. I do vlookups often and I'm stumped as to why this will only work on 2/3 of the data. I run this report monthly so all SKUs are the same as last month, we are just adding one more period of data.
Yes, they are exactly equal. I have no decimal points in my data, the data is SKUs not mathematical type numbers, so decimals are not applicable.
=VLOOKUP(F2,'[May 2022 Export - diagnostics.xlsx]May 2022 Export'!$F$2:$R$211707,13,FALSE)
Yes, they are exactly equal. I have no decimal points in my data, the data is SKUs not mathematical type numbers, so decimals are not applicable.
=VLOOKUP(F2,'[May 2022 Export - diagnostics.xlsx]May 2022 Export'!$F$2:$R$211707,13,FALSE)