If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Help needed separating data

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-30-05, 10:49
Robertma Robertma is offline
Registered User
 
Join Date: Mar 2004
Posts: 36
Help needed separating data

Is there some coding that will help me separate some data I'm working on.

Within a field titled 'Customer Surname' there is a reference of either AM or SM after the surname.

I.e. Smith SM
Jones AM

How do I separate the data so that I have the surname in one field and the reference in the next?

Thanks
Reply With Quote
  #2 (permalink)  
Old 11-30-05, 15:18
SR22Mike SR22Mike is offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA, Earth
Posts: 65
Hmmmm...

If you're only dealing with "AM" and "SM" I would suggest to get the surname.

If(Right(A1,2)="AM",LEFT(A1,FIND("AM",A1)-1),if(right(A1,2)="SM",left(a1,FIND("SM",A1)-1)))

To get the reference of "AM" or "SM" and if it's always at the end, then =Right(A1,2)
Reply With Quote
  #3 (permalink)  
Old 12-01-05, 07:58
Robertma Robertma is offline
Registered User
 
Join Date: Mar 2004
Posts: 36
Excellent, thanks for your help!
Reply With Quote
  #4 (permalink)  
Old 12-01-05, 08:50
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Or if that is exactly how all the cells are, you can use Data > Text to Column, and choose "space" as the separator.
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #5 (permalink)  
Old 12-05-05, 01:58
Bud Bud is offline
Registered User
 
Join Date: Dec 2003
Location: Dallas, TX
Posts: 995
Talking

Quote:
Originally Posted by shades
Or if that is exactly how all the cells are, you can use Data > Text to Column, and choose "space" as the separator.
Hey there Shades,

Wow, I just tried the Text to Column you suggested with the Comma delimiter and man was that awesome. Great tip.

BUD
Reply With Quote
  #6 (permalink)  
Old 12-05-05, 09:36
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Indeed, it saves considerable time, and avoids unnecessary formulas!
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On