Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to remove extract space in front of each value in a column?

Status
Not open for further replies.

Doraemon

IS-IT--Management
Sep 12, 2003
31
HK
I have two columns: First Name & Last Name
In the column, Last Name, each value in it has an extra space in front. What I would like to do is to remove the extra space for all values in that column.

Originally the column is:
Last Name
Tai Man
Cecila
Ka Man
Tin Yan
Choi Fan, Mavis

What I want is:
Last Name
Tai Man
Cecila
Ka Man
Tin Yan
Choi Fan, Mavis

Do anyone have any idea on how to remove the extra space in front of each value?

Thanks for your help in advance!
 
Try entering the following formula in the cell next to it. Assumes your data is in cell A1:

=MID(A1,2,999)

Rgds

John

 
Great! It can help to remove the extra space.
Thanks a lot!
 
Just FYI: ETID's Trim approach is better than Mid in this case because Mid will cause problems if it gets to a last name with no spaces in front or a last name with more than one space in front.

VBAjedi [swords]
 
Thanks for your reminder.

But I would like to ask how to combine two rows into one with a space in between?

That means,

First Name
Tai Man
Cecila
Ka Man
Tin Yan
Choi Fan, Mavis

Last Name
Chan
Wong
Leung
Fung
Chan


After combinatin as (First Name + space + Last Name):
Name
Chan Tai Man
Wong Cecila
Leung Ka Man
Fung Tin Yan
Chan Choi Fan, Mavis

Thanks for your help in advance. I know this is a simple question, but somehow can't find solution from help.


 
try this into cell C1 then drag it down.

=TRIM(A1) & " " & TRIM(B1)

Mike [pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top