Why won’t my VLookup formula work?

ebrandt

Board Regular
Joined
Dec 13, 2010
Messages
54
I have successfully used the VLookup formulas for years. It is one of my go to formulas in Excel.

I have a situation now that I can’t figure out. I am importing a list of codes from an outside source into my Excel workbook and trying to match them up with identical codes that already reside in my workbook and return the value of the cell to the right.

Although the values of the codes appear to be identical, Excel will not recognize them. I have also tried the Match function with the same result.

Am I missing something regarding the data from the outside source? Does it need to be reformatted in some way I am missing? I have tried lots of changes to the formatting of the data and checked to make sure there are no extra spaces to no avail.

Here is what a typical code looks like………..”01 45 23 - Material Testing and Special Inspections”

The Vlookup formula returns #N/A
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
As well as spaces have you checked for other non-printing characters?

For example CHAR(160) is quite common when data is sourced from the web.
 
Upvote 0
the data from the outside source may have non-printable characters like non breaking space or carriage return. Try using CLEAN to remove any non-printable characters.


something like
Code:
=VLOOKUP(CLEAN(A2),I7:J21,2,0)
 
Upvote 0
Hi,

CLEAN does not work for "non-breaking" spaces...

Try: =SUBSTITUTE(A1,CHAR(160)," ")

or FIND and REPLACE
 
Last edited:
Upvote 0
Why don't you place your set of codes in a sheet, append the new codes to te bottom of this and then apply a filter (advanced) ticking 'copy to . .' and 'Unique values'
 
Last edited:
Upvote 0
Post a sample spreadsheet with expected results, remove any sensitive data, create a mockup example if necessary.
You cant attach files on this forum. There are tools on this forum for adding small spreadsheet images

https://www.mrexcel.com/forum/about-board/508133-attachments.html

Or upload the file to an online storage site and post a link to it, though some people may not download the file for fear of viruses.
 
Upvote 0
Thanks for all of the suggestions! I finally figured it out.

The problem was with the original data that I was trying to match to. I remembered that it also came from an online app, and when I went back to it and used the Substitute formula to get rid of CHAR(160), my Vlookup worked.
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top