Combine firstt & last name

J

Jennie

I ahve a spreadsheet were the first name and last name are in sperate colums.
I can join combine the two and copy as a value. When I combine them though
there are several extra spaces. Does anyone know what causes this and how to
fix it? here is an example:

John Smith shows as John Smith
 
G

Gord Dibben

How are you joining/combining the two names?

=A1 & B1

=CONCATENATE(A1,A2)

Either method will produce spaces if you have extra spaces in the cell values.

Try =TRIM(A1 & " " & B2) to return John Smith


Gord Dibben MS Excel MVP
 
M

Mike G

The trim function does not neet the extra &" " in between. The definition
is: removes all spaces from a text string except for a single space between
words. Of course if you need more than one, then you would use " " but it
looks like the OP was looking for one, I am using 2007 version, don't
remember if other versions were different. So =TRIM(a1&b1)
 
G

Gord Dibben

Thanks Mike

Either formula produces a single spaced John Smith in Excel 2003

Yours is shorter<g>


Gord
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top