SOLVED

Why isn't my vlookup returning most of the values?

Brass Contributor

After I refresh my database Query 1 table, I try to lookup the slic column in Table2 to get the description in Table3. However, Only one of the descriptions is coming back. Any ideas? To be more exact, why am I getting #N/A in column F?

 

rodsan724_0-1634365784844.png

I thought I could use ISNUMBER and NUMBERVALUE but it works in one case but not the other???

rodsan724_0-1634417650767.png

 

rodsan724_0-1634417947132.png

 

 

8 Replies

@rodsan724 Most likely the 10, 20 and 30 are not the same type in both tables. One could be text and the other a number. Or if they are text in both tables, one could have one or more trailing spaces. Hence, #N/A as VLOOKUP doesn't find an exact match.

I attached the file to OP. I wasn't sure if I should l leave the data source so I deleted it. I can put back in if you like, I wasn't sure if the values would come in without the data source. I have control over Table3 but not the data source.

@rodsan724 Can't really tell where it went wrong, but some the data types were not in sync. I made it all Text and redid the VLOOKUP. Now it seems to work as expected. See attached.

 

 

 

The only control I have is over Table 3. What do I have to do to fix it? If I double click the Id cell and press enter it seems to fix itself. However, in my production case, I have thousands of records like this and can't manually do it for all those rows.
I think I figured it out by changing the VLOOKUP using ISNUMBER and NUMBERVALUE
Nevermind, it half-worked :( updated OP
best response confirmed by rodsan724 (Brass Contributor)
Solution
Figured it out!

=VLOOKUP(IF(ISNUMBER(VALUE(D2)),NUMBERVALUE(D2),D2),Table3,2,FALSE)

VLOOKUP
ISNUMBER
VALUE
NUMBERVALUE
1 best response

Accepted Solutions
best response confirmed by rodsan724 (Brass Contributor)
Solution
Figured it out!

=VLOOKUP(IF(ISNUMBER(VALUE(D2)),NUMBERVALUE(D2),D2),Table3,2,FALSE)

VLOOKUP
ISNUMBER
VALUE
NUMBERVALUE

View solution in original post