vlookup

mypig7

Active Member
Joined
Sep 27, 2004
Messages
285
sheet 1
- I have a first name in 1 box and a surname in another. I then combined them using '&' in a formula, with a space, and pasted values so I now have first name space surname
- I then tried to lookup that name in Sheet 2, and bring back a value next to it.


My issue
I get #n/a as the result.
In Sheet 1 the Vlookup looks at the new combined name, (as detailed above), if I retype the name over the top of it's self, the vlookup works.

Help!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Strange i just tried and it works fine for me.

Maybe try trimming the values when combining them?

=Trim(A1) & " " & Trim(B1)

for example
 
Upvote 0
Thanks, but that doesn't solve it. I think its because the data was exported from another system.
If I type in the name manually (first name space surname) it works, instead of combining first name space and surname. It's just that I have thousands of names
 
Upvote 0
Take a look at a match that isn't working, and apply the LEN function to each list and see what it returns.
Does it show the length of the two being the same?
Sometimes if data comes from external sources, it has extra spaces or special characters.
In order for the VLOOKUP to work, they must match EXACTLY (it doesn't matter if they were built by formula or not).

So the key here is to first identify what is different. Then we can work on cleaning up the data so that it will work.
 
Upvote 0
Hi,

May be also try this:


Book1
ABC
1JohnDoe John Doe
Sheet81
Cell Formulas
RangeFormula
C1=TRIM(CLEAN(A1&" "&B1))
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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