+ Reply to Thread
Results 1 to 7 of 7

Adding colon into existing cell

  1. #1
    Registered User
    Join Date
    12-15-2015
    Location
    Ohio
    MS-Off Ver
    Office 2013
    Posts
    2

    Adding colon into existing cell

    I am inputting a large quantity of data into a excel sheet. When I scan the barcode on the device it put a string of 12 hexadecimal characters into a cell, however to be able to use them for my application I need string separated into groups of 2 separated by a colon. Is there a way to quickly add the colons to the cells?

    EXAMPLE:
    the data scans in as 1a2b3c4d5e6f but to use it I need it to look like 1a:2b:3c:4d:5e:6f

  2. #2
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Adding colon into existing cell

    Please Login or Register  to view this content.
    Just dumb brute force, really.
    Click the [* Add Reputation] Button to thank people for help!
    Post Attachment: Click [Go Advanced] under the reply box; then click [Manage Attachments] to launch the attachments dialogue.
    Mark Thread Solved: Go to the top of the first post; Select [Thread Tools] dropdown; Pick the [Mark thread as Solved] option.

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Adding colon into existing cell

    maybe with this

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


    Data Range
    A
    B
    1
    1a2b3c4d5e6f
    1a:2b:3c:4d:5e:6f
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    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,194

    Re: Adding colon into existing cell

    Try this:

    =LEFT(A1,2)&":"&MID(A1,3,2)&":"&MID(A1,5,2)&":"&MID(A1,7,2)&":"&MID(A1,9,2)&":"&RIGHT(A1,2)

    GK edit: Ooops. I made a coffee and forgot to refresh before posting!!!!
    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

  5. #5
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Adding colon into existing cell

    @al

    They're hex numbers, so the "evens" could be any of 0-f (0-9 & a-f) at random. I don't think SUBSTITUTE is the way to go.

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Adding colon into existing cell

    Quote Originally Posted by ben_hensel View Post
    Just dumb brute force, really.
    Nothing wrong with Brute Force, sometimes that's really the only choice.


    Here's a VBA Custom UDF method.
    Put this code in a new VBA module
    Please Login or Register  to view this content.
    Then use it in a formula like
    =AddColon(A1)

  7. #7
    Registered User
    Join Date
    12-15-2015
    Location
    Ohio
    MS-Off Ver
    Office 2013
    Posts
    2

    Re: Adding colon into existing cell

    Thank you guys! I ended up using the brute force method since it didn't have to be anything fancy!

    =MID(B2,1,2)&":"&MID(B2,3,2)&":"&MID(B2,5,2)&":"&MID(B2,7,2)&":"&MID(B2,9,2)&":"&MID(B2,11,2)

+ 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. Adding a colon in a cell between text and a date
    By raperm in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-06-2014, 02:40 PM
  2. [SOLVED] Adding a Colon in a text string
    By dwhite30518 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-02-2013, 03:04 PM
  3. Replies: 4
    Last Post: 07-24-2013, 03:23 PM
  4. Adding a term (cell) to an existing formula
    By Brocktanor in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-19-2013, 10:03 AM
  5. [SOLVED] Adding minutes to existing time in a cell
    By VKS in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-24-2013, 02:24 AM
  6. Random colon delimitation help - Remove colon delimiter?
    By ebahr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2008, 03:33 PM
  7. Adding hyperlink after the existing data in the cell
    By helpwithXL in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-30-2005, 03:06 PM

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