User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » EXCEL Q: Text to Column Page [1]  
CalliPHISH
All American
10883 Posts
user info
edit post

I have a column that is a lenthy sentence downloaded from software. In each unique sentence there is an account number. Each account number starts with the same 3 digits and has a hyphen.

Is there any way to pull just this from the sentence into a column? Or, pull each thing out but seperate the account number?

Right now the best I can come up with is to put each word in a column that's seperated with a space... hoping for something better than this.

2/17/2011 3:21:00 PM

Chance
Suspended
4725 Posts
user info
edit post

If you have to do this in excel then it would be better to use a regular expression to snag it. If it doesn't have to be excel, then it would be best to use perl to use a regular expression to snag it.

2/17/2011 5:33:47 PM

HaLo
All American
14273 Posts
user info
edit post

=LEFT(RIGHT(A1,LEN(A1)-SEARCH("@@@",A1)+1),#)

where
A1 = cell which has the sentence
@@@ = the first three digits of the account number
# = the number of characters in the account number (including the hyphen)

this worked on a quick test case in excel 2010. you may have to fiddle with it to get it to work for you.

OR

=LEFT(RIGHT(A1,LEN(A1)-SEARCH("-",A1)+4),#)

this works for any account number assuming that the format is ###-#####... and the account number is a standard length each time. it also assumes there are no other hyphens in the sentence.

again:

A1 = cell which has the sentence
# = the number of characters in the account number (including the hyphen)


[Edited on February 18, 2011 at 1:47 AM. Reason : .]

2/18/2011 1:42:23 AM

 Message Boards » Tech Talk » EXCEL Q: Text to Column Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.