Insert Comma every 50 characters in a cell

narelle_s

New Member
Joined
Jul 21, 2009
Messages
6
Hi,

Is that possible?

I have addresses in Excel cells, and need to insert a comma every 50 characters (max of 2 commas if possible).

eg.
[FONT=&quot]ISTS Building E Mawson Lane 349 Gibson Road Maybury 9061
[/FONT][FONT=&quot]becomes
ISTS Building E Mawson Lane 349 Gibson Road Maybur,y 9061[/FONT]

I found some help on another board that suggested something like this for a similar issue, but I have no idea how to change that to suit me!

=LEFT(F4,50)&","&MID(F4,1,50)

which just keeps repeating the same 50 characters and deleting the rest.

Thanks,
Narelle
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
So, you want it to insert a comma in the middle of a word?

This will insert a comma based on your example above:

=LEFT(A1,50)&","&MID(A1,51,LEN(A1))
 
Last edited:
Upvote 0
Good heavens that was quick!

Thank you.

I think I do (am waiting to confirm that middle of the word is OK), but that helps. If there are more than 100 characters, what would I do to have it insert one every 50 characters?

Thanks,
Narelle
 
Upvote 0
If this is a one time thing, I would just repeat the procdure. If it's not a one time thing then someone will be along shortly with a solution...too late at night and too long of a day to think...

And when I say repeat, I really mean use this based on the result of the first formula:

=LEFT(B1,100)&","&MID(B1,101,LEN(B1))

Untested, but you get the idea...
 
Last edited:
Upvote 0
I just had a look at how many are over 100, there is not that many. So that answer will do me fine. Thank you again for replying so quickly!
 
Upvote 0
Code:
=LEFT(C3,50) & "," & MID(C3,51,50) & "," & RIGHT(C3,(Len(C3)-100))

If you have more than 100 characters, this will work.

OOOPS...stand by....

There we go, lol...sorry.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,515
Messages
6,114,080
Members
448,548
Latest member
harryls

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