Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Trim cell contents
I have a long list of names in Excel where the first and last name are in one
cell. I want to split the names with first name in one cell and last name in another cell. I know how to use the "Left" and "right" functions but then I have to use a different formula for each name since each name is a different length. Is there an easier way to do this? -- Kim |
#2
|
|||
|
|||
You bet. See Data--Text to Columns:
http://www.officearticles.com/excel/...soft_excel.htm ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "Kim C via OfficeKB.com" wrote in message ... I have a long list of names in Excel where the first and last name are in one cell. I want to split the names with first name in one cell and last name in another cell. I know how to use the "Left" and "right" functions but then I have to use a different formula for each name since each name is a different length. Is there an easier way to do this? -- Kim |
#3
|
|||
|
|||
Hi Kim,
Try this: =LEFT(TRIM(A1),FIND(" ",TRIM(A1))-1) and =MID(TRIM(A1),FIND(" ",TRIM(A1))+1,LEN(TRIM(A1))) Regards, KL "Kim C via OfficeKB.com" wrote in message ... I have a long list of names in Excel where the first and last name are in one cell. I want to split the names with first name in one cell and last name in another cell. I know how to use the "Left" and "right" functions but then I have to use a different formula for each name since each name is a different length. Is there an easier way to do this? -- Kim |
#4
|
|||
|
|||
Thanks - that was too easy!
Anne Troy wrote: You bet. See Data--Text to Columns: http://www.officearticles.com/excel/...soft_excel.htm ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com I have a long list of names in Excel where the first and last name are in one cell. I want to split the names with first name in one cell and last name in another cell. I know how to use the "Left" and "right" functions but then I have to use a different formula for each name since each name is a different length. Is there an easier way to do this? -- Kim Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...tions/200507/1 |
#5
|
|||
|
|||
Thanks for your help.
KL wrote: Hi Kim, Try this: =LEFT(TRIM(A1),FIND(" ",TRIM(A1))-1) and =MID(TRIM(A1),FIND(" ",TRIM(A1))+1,LEN(TRIM(A1))) Regards, KL I have a long list of names in Excel where the first and last name are in one [quoted text clipped - 5 lines] different length. Is there an easier way to do this? -- Kim Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...tions/200507/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Display contents of a specific cell even if a group of cells is mo | Excel Worksheet Functions | |||
Function syntax to compare cell contents | Excel Worksheet Functions | |||
How do I find the contents of a cell using the "ADDRESS" function. | Excel Worksheet Functions | |||
Insert new row as cell contents change | Excel Discussion (Misc queries) | |||
GET.CELL | Excel Worksheet Functions |