ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Seperating values (https://www.excelbanter.com/excel-discussion-misc-queries/209735-seperating-values.html)

One-Leg

Seperating values
 
Hello,

I have a list of about 5000 cities with their associated state (seperated
with a coma). The list of cities are in colomn "A".

How can I automatically have the city copied into column "B" and the state
in column "C" without having to use the TEXT TO COLUMN option?

For the state, I can use "=RIGHT(A2,2)" so I'm ok with that. It's how do I
do the same for the city as every cities have different amount of characters
but are all located in front of a coma.

Thanks!!!

John C[_2_]

Seperating values
 
Assuming everything is in format of: city name, ST
State, as you said: =RIGHT(A2,2)
City would be: =LEFT(A2,LEN(A2)-4)
--
** John C **
Please remember if your question is answered, to mark it answered :). It
helps everyone.


"One-Leg" wrote:

Hello,

I have a list of about 5000 cities with their associated state (seperated
with a coma). The list of cities are in colomn "A".

How can I automatically have the city copied into column "B" and the state
in column "C" without having to use the TEXT TO COLUMN option?

For the state, I can use "=RIGHT(A2,2)" so I'm ok with that. It's how do I
do the same for the city as every cities have different amount of characters
but are all located in front of a coma.

Thanks!!!


One-Leg

Seperating values
 
Thank you!!! It worked like a charm...

"John C" wrote:

Assuming everything is in format of: city name, ST
State, as you said: =RIGHT(A2,2)
City would be: =LEFT(A2,LEN(A2)-4)
--
** John C **
Please remember if your question is answered, to mark it answered :). It
helps everyone.


"One-Leg" wrote:

Hello,

I have a list of about 5000 cities with their associated state (seperated
with a coma). The list of cities are in colomn "A".

How can I automatically have the city copied into column "B" and the state
in column "C" without having to use the TEXT TO COLUMN option?

For the state, I can use "=RIGHT(A2,2)" so I'm ok with that. It's how do I
do the same for the city as every cities have different amount of characters
but are all located in front of a coma.

Thanks!!!


ShaneDevenshire

Seperating values
 
Hi,

Question - why not use the text to columns wizard?

--
Thanks,
Shane Devenshire


"One-Leg" wrote:

Hello,

I have a list of about 5000 cities with their associated state (seperated
with a coma). The list of cities are in colomn "A".

How can I automatically have the city copied into column "B" and the state
in column "C" without having to use the TEXT TO COLUMN option?

For the state, I can use "=RIGHT(A2,2)" so I'm ok with that. It's how do I
do the same for the city as every cities have different amount of characters
but are all located in front of a coma.

Thanks!!!



All times are GMT +1. The time now is 05:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com