ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   vlookup Problem (https://www.excelbanter.com/excel-discussion-misc-queries/61582-vlookup-problem.html)

marksuza

vlookup Problem
 

HI,

I am having a little problem with a vlookup formula and I was wondering
if anyone could help me. I copied and pasted two tables from the
internet to excel and I trying to combine information from both (they
have one column in common), I am using a vlookup formula but it is not
working, =VLOOKUP(A6,$N$4:$O$348,2). Now, if I choose a specific
record and copy and paste the name of that record (A6, for example) to
the corresponding record in column 'N', the formula works. I guess
excel is not identifying the names are the same. Can anybody help me
solve this? Thanks a lot.

Regards,

Mark


--
marksuza
------------------------------------------------------------------------
marksuza's Profile: http://www.excelforum.com/member.php...fo&userid=2659
View this thread: http://www.excelforum.com/showthread...hreadid=495506


Dave O

vlookup Problem
 
Hi, Mark-
It sounds like the entries in the different files are visually
identical but not truly identical. For example, one file may contain
"John Doe" and the other "John Doe " (note the extra space at the end
of Doe). Or the entry may start out with an apostrophe, which happens
frequently with imported files.

Is this happening in your data?


marksuza

vlookup Problem
 

Yes Dave, I just checked and in one of them I have an extra space at the
end. Is there a formula to get this space out in all the rows. Thanks
for the help once again.

Regards,

Marcos


--
marksuza
------------------------------------------------------------------------
marksuza's Profile: http://www.excelforum.com/member.php...fo&userid=2659
View this thread: http://www.excelforum.com/showthread...hreadid=495506


Dave Peterson

vlookup Problem
 
Maybe inserting a helper column of cells with formulas like:

=trim(a1)
and drag down.
Then copy|paste special|values over the original range and delete the helper
column.

=trim() will remove leading/trailing/repeated embedded spaces, too

If you want to cheat (this is usually a bad idea!):

=VLOOKUP(A6,$N$4:$O$348,2)
becomes
=VLOOKUP(trim(A6),$N$4:$O$348,2)

But it's always better to fix the data.

marksuza wrote:

Yes Dave, I just checked and in one of them I have an extra space at the
end. Is there a formula to get this space out in all the rows. Thanks
for the help once again.

Regards,

Marcos

--
marksuza
------------------------------------------------------------------------
marksuza's Profile: http://www.excelforum.com/member.php...fo&userid=2659
View this thread: http://www.excelforum.com/showthread...hreadid=495506


--

Dave Peterson


All times are GMT +1. The time now is 02:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com