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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2007 trim both sides of a space 2

Status
Not open for further replies.

cjbrown815

IS-IT--Management
Mar 2, 2006
525
US
I have a column that has entries like
<buildingname-buildingnumber 'space' extension>

How do I tell excel to show me everything to the left of the space or right of the space regardless of the amount of characters?

Thanks
cj


-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
For characters to the left:
[tab]=LEFT(A1, SEARCH(" ", A1) - 1)

Here are a couple of ways to return the characters to the right:
[tab]=MID(A1, SEARCH(" ", A1) + 1, 999)
or
[tab]=RIGHT(A1, LEN(A1) - SEARCH(" ", A1))

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 




Also, check out Data > Text to columns - DELIMITED (using SPACE)

This will "parse" the value in your column into the column and adjacent column(s).

So if you column has data like
[tt]
| A |
buildingname-buildingnumber extension
[/tt]
after parsing...
[tt]
| A | B |
buildingname-buildingnumber extension
[/tt]



Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top