SOLVED

# Adding a , after a group of text

Copper Contributor

# Adding a , after a group of text

Good morning, I was looking to add a ,(coma) and a space after every 4 characters.

For example,

qwerasdfzxcv ------> qwer, asdf, zxcv

not always will it always be 12 characters but will always be sets of 4 characters

Ive been able to just add 1 , after qwer, but no multple using

=replace(a1,5,0,", ")

im sure I can probably tie in the same formula Mutiple times but have no clue how

4 Replies
best response confirmed by FatManFluff (Copper Contributor)
Solution

# Re: Adding a , after a group of text

=TEXTJOIN(", ", TRUE, MID(A1, SEQUENCE(ROUNDUP(LEN(A1)/4, 0), , , 4), 4))

# Re: Adding a , after a group of text

this worked like a charm but just noticed that I do indeed have some charters that 5 characters and not always 4 so its mixed combination of 4 and 5 character all in random sequence. There some instances where it even has a space so then it throws everything off.

For example,

qwer asdfzxcv

Regardless thank you for the help and your answer was indeed correct when always a 4 character combination

# Re: Adding a , after a group of text

Is there a rule that determines when to use 4 or 5 characters?

# Re: Adding a , after a group of text

Unfortunately no it’s at random so that’s y I feel like there won’t be anything I can use and sometimes the 5 characters are in the front middle or the back.
1 best response

Accepted Solutions
best response confirmed by FatManFluff (Copper Contributor)
Solution

# Re: Adding a , after a group of text

=TEXTJOIN(", ", TRUE, MID(A1, SEQUENCE(ROUNDUP(LEN(A1)/4, 0), , , 4), 4))