I have a data sheet with about 3000 entries, each one containing an
address. Only problem is that it was brought in from another program and
when they did it it grouped the City and the street address. So, I have
one cell for each entry that looks like;
123 Easy Street London
all in one cell.
I would like to put London in another cell, so that I can sort by city
without soing each one individually. Any ideas?
thx,
AHello,
Assuming that your address is in cell A1, the formula below should do the
trick.
=RIGHT(A1,LEN(A1)-FIND(quot;*quot;,SUBSTITUTE(A1,quot; quot;,quot;*quot;,LEN(A1)-LEN(SUBSTITUTE(A1,quot;
quot;,quot;quot;)))))
--
Hope this helps,
MarkNquot;Jillquot; wrote:
gt; I have a data sheet with about 3000 entries, each one containing an
gt; address. Only problem is that it was brought in from another program and
gt; when they did it it grouped the City and the street address. So, I have
gt; one cell for each entry that looks like;
gt;
gt; 123 Easy Street London
gt;
gt; all in one cell.
gt;
gt; I would like to put London in another cell, so that I can sort by city
gt; without soing each one individually. Any ideas?
gt;
gt; thx,
gt;
gt; A
gt;
gt;
Is there any kind of quot;character, (i.e. ,)quot; between the City and Street
address?
If there is on the Menu Bar - Select - DATA - Text to Columns and
follow the directions. If not you might try the following:
Select the column and Format ALL Cells with a COURIER FONT.
Select your column again and:
Do a Find and Replace: In the Find box - press the spacebar 2 times, In
the Replace press the spacebar 1 time. Do this as many times as
necessary to remove quot;ALLquot; extra spaces - you only want one space
between each of the 'words.quot; You will know you have accomplished this
when you get a quot;NOT FOUNDquot; message.
Now in the Find Box press the space bar 1 time.
In the Replace Box - press the the space bar 20 to 25 times, and select
replace ALL - this should put enough space between the quot;shortest and
longestquot; address:
Now do a quot;RIGHT JUSTIFYquot; on the Column. This should put everything
Lined flush right for the Cities. quot;Left Justifyquot; might work better -
you will be able to determine in the next step.
Insert a blank column to the right of the above column. quot;New Column Bquot;
With your column selected on the Menu Bar, Select, DATA - Text to
Columns, then select quot;Fixed Widthquot; - click the NEXT. Now comes the
quot;trial and error.quot;
Remove all breaks, except the one by the cities. Move or place it in a
position before the cities and then scroll down as necessary to view
how your column will break. If you are satisified select NEXT and then
FINISH.
Now in a quot;blank column (i.e. C) enter the following formula: =TRIM(B1)
and copy down, this will remove all of the extra spaces. Then copy all
of column C and do a Paste - Special - quot;Valuesquot; - then do the same for
column A.
Might be an easier way - but I don't know of it.--
wjohnson
------------------------------------------------------------------------
wjohnson's Profile: www.excelforum.com/member.php...oamp;userid=29640
View this thread: www.excelforum.com/showthread...hreadid=513501The following formula, which will be found in this newsgroup from time
to time, will extraqct the last word of a multi-word entry, separated
by spaces. It assumes the entry is in E3:
=MID(E3,FIND(CHAR(1),SUBSTITUTE(E3,quot;
quot;,CHAR(1),LEN(E3)-LEN(SUBSTITUTE(E3,quot; quot;,quot;quot;)))) 1,255)
The following formula will extract up to and excluding the last word:
=LEFT(E3,FIND(CHAR(1),SUBSTITUTE(E3,quot;
quot;,CHAR(1),LEN(E3)-LEN(SUBSTITUTE(E3,quot; quot;,quot;quot;))))-1)
HTH
Kostis VezeridesJill gt; wrote in
:
gt; I have a data sheet with about 3000 entries, each one containing an
gt; address. Only problem is that it was brought in from another program
gt; and when they did it it grouped the City and the street address. So,
gt; I have one cell for each entry that looks like;
gt;
gt; 123 Easy Street London
gt;
gt; all in one cell.
gt;
gt; I would like to put London in another cell, so that I can sort by city
gt; without soing each one individually. Any ideas?
gt;
gt; thx,
gt;
gt; A
gt;
gt;
I've got it all sorted out guys; thanks for the help.
A
- Jun 04 Wed 2008 20:44
SORT/SEPERATE DATA
close
全站熱搜
留言列表
發表留言