RE: Extracting data for address lists



Hi,

Posting a sample of your data would have been helpful because there are a
couple of ways of doing this. The simplest is probably using

Data|Text to columns and splitting the data in that way.

Another method involves finding the commas using FIND and then using Left,
right or Mid to seperate the data like this:
=FIND(",",A1,1)
finds the first comma so
=LEFT(A1,FIND(",",A1,1)-1)
Returns everyting before that comma

To find the second comma use
=FIND(",",A1,FIND(",",A1,1)+1)
This the same as the first find but because we know the position of the
first comma from that formula we can use that position (+1) to find the
second so now using mid the text between the first and second comma can be
extracted.

=MID(A1,FIND(",",A1,1)+1,FIND(",",A1,FIND(",",A1,1)+1)-FIND(",",A1,1)-1)

Mike
"firestorm1954" wrote:

I can use LEFT and MID to split certain lists, but where I have a whole
address in a cell, separated by commas, I need to take the data before the
first comma to another cell, the data between the next pair of commas to
another cell and so on. I can do this labouriously column by column, but is
there any shorter way where the program can look for data between sets of
characters (in this case the commas)?
.



Relevant Pages

  • Re: Formatting...
    ... Not sure I follow you completely but to kill everything from the first comma ... Now when I run the script the output is like this: ... How can I kill these extra commas? ...
    (microsoft.public.scripting.vbscript)
  • Re: Tony Coopers downhill slide
    ... >zeroed in on the undesirable interruption the first comma ... >to understand what the purpose of the comma was and probably ... >remark being punctuated as parenthetical. ... parenthetical phrase out of something that need not - even should not ...
    (alt.usage.english)
  • Re: Reference Field Error!
    ... Insert a bookmark starting at the left side of the first comma and ending at ... Reference Source not found" in the reference fields, ...
    (microsoft.public.word.vba.general)
  • Re: Tony Coopers downhill slide
    ... >>>zeroed in on the undesirable interruption the first comma ... >>>to understand what the purpose of the comma was and probably ... This defense of the punctuation because it is the choice of the writer ... Especially since it's followed by a justified parenthetical phrase. ...
    (alt.usage.english)
  • Re: Elegant equivalent to this regex?
    ... (comma delimited) ... This would (worst case and highest specification) ... print join "\n", @hits; ...
    (comp.lang.perl.misc)