Insert comma in string

tagger

Board Regular
Joined
Jun 1, 2002
Messages
97
How do you insert a comma into a string in the position before the first number in the string. The string contains both numbers and letters.I have columns with names and addresses that have no space between the end of name and beginning of the address. The most likely occurance are #'s after the name, yes I know PO BOX and RR etc will mess it up, but have to start somewhere, Then I want to insert the comma and then use text to columns to parse. If there is a better way let me know. Thanks!!!
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Yes I should. My Oversite Thank You!!
STORAGE USA2135 COLUMBIANA RD
A SAFE MINI STORAGE2650 E SOUTH BLVD
AAA MINI STORAGE441 HACKEL DR
ACE MINI SELF-STORAGE3620 DAY ST
ADVANCE MOVING & STORAGE254 HUNTER ST
ADVANCED SELF STORAGE6010 MONTICELLO DR
ALABAMA MINI STORAGE561 OLIVER RD
AMERICAN MINI STORAGE2931 DAY ST
A LOW COSTSELF STORAGE 7211 ARLINGTON AVE
PUBLIC STORAGE 6379 MISSION BLVD

Notice some have a space others don't. I can eliminate extra spaces later but, I need a comma , it will be easier to parse to separate into column. As far as PO and RR I ca use find and replace to coorect and inser comma.
 
Upvote 0
On 2002-06-29 06:31, tagger wrote:
Yes I should. My Oversite Thank You!!
STORAGE USA2135 COLUMBIANA RD
A SAFE MINI STORAGE2650 E SOUTH BLVD
AAA MINI STORAGE441 HACKEL DR
ACE MINI SELF-STORAGE3620 DAY ST
ADVANCE MOVING & STORAGE254 HUNTER ST
ADVANCED SELF STORAGE6010 MONTICELLO DR
ALABAMA MINI STORAGE561 OLIVER RD
AMERICAN MINI STORAGE2931 DAY ST
A LOW COSTSELF STORAGE 7211 ARLINGTON AVE
PUBLIC STORAGE 6379 MISSION BLVD

Notice some have a space others don't. I can eliminate extra spaces later but, I need a comma , it will be easier to parse to separate into column. As far as PO and RR I ca use find and replace to coorect and inser comma.

Let A1 house the first entry that needs a comma at the appropriate position.

In B1 array-enter and copy down as far as needed.

=MATCH(1,ISNUMBER(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)+0)+0,0)

Note. In order to array-enter a formula you need to hit control+shift+enter at the same time, not just enter.

In C1 enter and copy down:

=REPLACE(A1,B1,1,","&MID(A1,B1,1))

The Text to Columns bit I leave to you.
 
Upvote 0

Forum statistics

Threads
1,213,490
Messages
6,113,956
Members
448,535
Latest member
alrossman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top