Closed Thread
Results 1 to 4 of 4

Add comma after 2 digits, rows with varying number of digits.

  1. #1
    Registered User
    Join Date
    06-04-2021
    Location
    United States
    MS-Off Ver
    2019
    Posts
    4

    Add comma after 2 digits, rows with varying number of digits.

    I am working on a data import for work that contains rows with varying numbers of digits in each row. However, I need each to be comma separated (every 2) to work in the import.
    A few things:

    - The numbers vary in every row. It could be XXX or XXXXXXXXXXXXXXXXX
    - The commas need to be coming from the right so X,XX or X, XX, XX, XX, XX, XX, XX, XX, XX

    If the number of digits was the same in every row this wouldn't be an issue, but because they vary, I cannot find a solution to this.

    I should add I tried formatting the number as XX, XX, XX, XX in the number format screen but it does not hold. I also tried ##","##","##","##","## but that leaves extra commas if there are not enough numbers in the cell, which will not work in my import.

    Any ideas?!

    Thanks in advance!

  2. #2
    Forum Contributor
    Join Date
    05-09-2021
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    148

    Re: Add comma after 2 digits, rows with varying number of digits.

    Hello Elodie,

    Created this as a function so that you can implement it where you want.

    Please Login or Register  to view this content.
    You would call the function like so:
    Please Login or Register  to view this content.
    Tested and works

    Good luck!

  3. #3
    Registered User
    Join Date
    06-04-2021
    Location
    United States
    MS-Off Ver
    2019
    Posts
    4

    Re: Add comma after 2 digits, rows with varying number of digits.

    Thank you!!

  4. #4
    Registered User
    Join Date
    09-28-2022
    Location
    Belgium
    MS-Off Ver
    2019
    Posts
    1

    Re: Add comma after 2 digits, rows with varying number of digits.

    Hello,

    Could you please upload a workbook where you demonstrate this function?

    Kind regards

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Add comma after 2 digits
    By wietsehoogsteen in forum Excel General
    Replies: 29
    Last Post: 05-21-2022, 12:55 AM
  2. How to ID digits within a group of 8-digits that equal a specified number
    By Thunder001 in forum Excel Formulas & Functions
    Replies: 31
    Last Post: 07-04-2019, 02:49 AM
  3. Replies: 4
    Last Post: 11-09-2017, 02:05 PM
  4. Import from *.csv cuts off digits after comma
    By mary26 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2015, 12:52 PM
  5. Replies: 9
    Last Post: 10-16-2013, 06:17 AM
  6. Replies: 5
    Last Post: 12-08-2008, 11:47 AM
  7. [SOLVED] Digits after the comma in Userform
    By Gert-Jan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-04-2006, 08:55 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