+ Reply to Thread
Results 1 to 26 of 26

How to insert comma between every character

  1. #1
    Registered User
    Join Date
    04-16-2019
    Location
    London
    MS-Off Ver
    O365 (PC) V 2210
    Posts
    56

    How to insert comma between every character

    Hi

    I would like to know a formula for inserting a comma between every character in the cells of a column.

    The cells all have numbers ranging from 1 character to 8 characters (no spaces)

    e.g.

    11
    111111
    1121
    122
    1111122

    I would like this to end up as

    1,1
    1,1,1,1,1,1
    1,1,2,1
    1,2,2
    1,1,1,1,1,2,2

    Regards

    Jonathan

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,500

    Re: How to insert comma between every character

    you say between 1 and 8 characters, do you have only 1? so that if it is 1 you want to show 1,?
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    04-16-2019
    Location
    London
    MS-Off Ver
    O365 (PC) V 2210
    Posts
    56

    Re: How to insert comma between every character

    Hi

    I only require any instance of at least 2 or more characters to be split by a comma.

    If it is 1 character, nothing needs to happen

    Regards

  4. #4
    Valued Forum Contributor
    Join Date
    06-23-2021
    Location
    Romania
    MS-Off Ver
    2021, 365 v 2208
    Posts
    722

    Re: How to insert comma between every character

    With Power Query
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Diana Tanase


    If the solutions offered helped you to solve your problem, then mark the thread as SOLVED (thread tools in the top menu) and you can click on * to add reputation to those who helped you, as a way to say thank you !

  5. #5
    Registered User
    Join Date
    04-16-2019
    Location
    London
    MS-Off Ver
    O365 (PC) V 2210
    Posts
    56

    Re: How to insert comma between every character

    Hi

    Thanks, but is there a normal formula way of achieving this, as I have no idea where to begin with power query.

    Regards

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,098

    Re: How to insert comma between every character

    Are you still using 2016 or do you now have a newer version?

  7. #7
    Registered User
    Join Date
    04-16-2019
    Location
    London
    MS-Off Ver
    O365 (PC) V 2210
    Posts
    56

    Re: How to insert comma between every character

    Quote Originally Posted by Sam Capricci View Post
    you say between 1 and 8 characters, do you have only 1? so that if it is 1 you want to show 1,?
    I found this formula which inserts a comma after the second character, but how do I repeat this for every following found character?

    =REPLACE(E2,2,,",")

    Regards

  8. #8
    Registered User
    Join Date
    04-16-2019
    Location
    London
    MS-Off Ver
    O365 (PC) V 2210
    Posts
    56

    Re: How to insert comma between every character

    Quote Originally Posted by Fluff13 View Post
    Are you still using 2016 or do you now have a newer version?
    I have the latest version of O365 including Excel, as far as I know.

    Regards

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,101

    Re: How to insert comma between every character

    Check version here:
    Attached Images Attached Images
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,098

    Re: How to insert comma between every character

    Ok, how about
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I would also suggest you update your profile

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,101

    Re: How to insert comma between every character

    If you have O365.... seen above my redacted email address, this will do it:

    =TEXTJOIN(",",,MID(A1,SEQUENCE(LEN(A1)),1))

  12. #12
    Registered User
    Join Date
    04-16-2019
    Location
    London
    MS-Off Ver
    O365 (PC) V 2210
    Posts
    56

    Re: How to insert comma between every character

    Quote Originally Posted by Glenn Kennedy View Post
    Check version here:
    Microsoft 365 MSO version 2210 Build 16.0.15726.20188 32 bit

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,101

    Re: How to insert comma between every character

    Ta. Please update your profile... model it on mine.

  14. #14
    Registered User
    Join Date
    04-16-2019
    Location
    London
    MS-Off Ver
    O365 (PC) V 2210
    Posts
    56

    Re: How to insert comma between every character

    Quote Originally Posted by Glenn Kennedy View Post
    If you have O365.... seen above my redacted email address, this will do it:

    =TEXTJOIN(",",,MID(A1,SEQUENCE(LEN(A1)),1))
    That almost works!

    But it inserts 2 commas between each character for some reason.

    1,,1,,1,,1,,1

    like that.

    Regards

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,101

    Re: How to insert comma between every character

    I see only 1.
    Attached Files Attached Files

  16. #16
    Valued Forum Contributor
    Join Date
    06-23-2021
    Location
    Romania
    MS-Off Ver
    2021, 365 v 2208
    Posts
    722

    Re: How to insert comma between every character

    Quote Originally Posted by MrRAMMounts View Post
    That almost works!

    But it inserts 2 commas between each character for some reason.

    1,,1,,1,,1,,1

    like that.

    Regards
    It seems that your text have spaces between digits.
    In this case use Substitute function
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  17. #17
    Registered User
    Join Date
    04-16-2019
    Location
    London
    MS-Off Ver
    O365 (PC) V 2210
    Posts
    56

    Re: How to insert comma between every character

    Quote Originally Posted by Glenn Kennedy View Post
    I see only 1.
    All my characters look like this in the cell

    111

    But when i click in the cell the entry box shows this

    1 1 1

    Is there some formating issue you think is making it not work on mine?

    Regards

  18. #18
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: How to insert comma between every character

    Please try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  19. #19
    Valued Forum Contributor
    Join Date
    06-23-2021
    Location
    Romania
    MS-Off Ver
    2021, 365 v 2208
    Posts
    722

    Re: How to insert comma between every character

    Quote Originally Posted by MrRAMMounts View Post
    All my characters look like this in the cell

    111

    But when i click in the cell the entry box shows this

    1 1 1

    Is there some formating issue you think is making it not work on mine?

    Regards
    Then use Substitute like I said before

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  20. #20
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,098

    Re: How to insert comma between every character

    It would help if you could supply a workbook, showing the problem.
    Especially as 3 people have now posted the same formula, it should work

  21. #21
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,098

    Re: How to insert comma between every character

    Then use Substitute like I said before
    But substitute what, we have no way of knowing what those extra characters are.

  22. #22
    Registered User
    Join Date
    04-16-2019
    Location
    London
    MS-Off Ver
    O365 (PC) V 2210
    Posts
    56

    Re: How to insert comma between every character

    Quote Originally Posted by HansDouwe View Post
    Please try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Perfect that works.

    I also had to run =clean() on the column as I think there were some formatting issues there.

    Thanks for the help!

    Regards

  23. #23
    Valued Forum Contributor
    Join Date
    06-23-2021
    Location
    Romania
    MS-Off Ver
    2021, 365 v 2208
    Posts
    722

    Re: How to insert comma between every character

    Quote Originally Posted by Fluff13 View Post
    But substitute what, we have no way of knowing what those extra characters are.
    You're right, just guessing here!

  24. #24
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,098

    Re: How to insert comma between every character

    All three formulas supplied are the same, so if one works they all should.
    I also had to run =clean() on the column
    sounds like you have some linefeeds in there. In which case this should also work
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    so that you don't need to clean the column.

  25. #25
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: How to insert comma between every character

    you can read and learn about Power Query here: https://learn.microsoft.com/en-us/power-query/

    another way with PQ

    Please Login or Register  to view this content.
    raw Commas
    11
    1,1
    111111
    1,1,1,1,1,1
    1121
    1,1,2,1
    122
    1,2,2
    1111122
    1,1,1,1,1,2,2

  26. #26
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,101

    Re: How to insert comma between every character

    MrRAMMounts... there's a lesson here for you. Always include a SMALL sample sheet. That way confusion is minimised! Maybe not avoided, but minimised.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] if a string doesn't contain a character insert that character.
    By LenaK in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 01-31-2015, 12:54 PM
  2. [SOLVED] If found character insert a comma after it
    By Nelson.B22 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-03-2014, 01:13 PM
  3. [SOLVED] Remove the first character only if it is a comma
    By Pearlyn in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-02-2013, 10:17 AM
  4. Replies: 3
    Last Post: 11-08-2012, 05:01 PM
  5. [SOLVED] If comma present, then place a character before and after comma (FORMULA)
    By jaimealvarez in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2012, 04:04 PM
  6. Comma Showing Odd Character
    By ryanb4614 in forum Excel General
    Replies: 4
    Last Post: 07-31-2010, 12:58 AM
  7. How Remove Comma in the first character
    By antoni in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-23-2009, 01:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1