+ Reply to Thread
Results 1 to 5 of 5

How to separate text in cell

  1. #1
    Registered User
    Join Date
    12-18-2003
    Posts
    26

    How to separate text in cell

    How to separate text in cell on 2 digit blocks using the separator ":"
    Example:
    Cell A1 --> 0040CA69402E
    Cell A2 will be --> 00:40:CA:69:40:2E
    Oleg

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561
    I'm frustrated...

    I've written two formulae which are not necessarily the best way of doing this - the point is that they are copyable - I'm sure I should be able to combine the logic into an array formula - instead of an ugly "left(x,2)" & ":" & (mid(x,3,2)) &...

    Of course, this works...
    =LEFT(A3,2)&":"&MID(A3,3,2)&":"&MID(A3,5,2)&":"&MID(A3,7,2)&":"&MID(A3,9,2)&":"&MID(A3,11,2)
    but it ain't pretty

    Any legends able to make the array formula I'm sure exists?

    HTH
    Attached Files Attached Files

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Probably, there is a better way...but this for starters:

    Please Login or Register  to view this content.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Actually, if you install the free addin called Morefunc...(http://xcell05.free.fr/morefunc/english/) and use the MCONCAT() function, then you can use this array formula:

    Please Login or Register  to view this content.
    where A2 contains the code to parse.

    edit: This formula also accomodates for any even-lengthed code
    Last edited by NBVC; 09-24-2008 at 11:52 AM.

  5. #5
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650
    Hi Here's a UDF.
    Right click sheet "Tab", Select "View Code", From Vb Window Select "Insert", "Module". Paste in new window.
    To Run, Enter in cell:- =Colon(), (Select Cell with Data to go in Brackets)
    Please Login or Register  to view this content.
    Regards Mick

+ 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. Toggle Text Color in Cell A, when Cell B clicked...
    By woodman650 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-04-2008, 02:22 AM
  2. Append Cell Values To Text Files
    By Stefan.S. in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-17-2008, 11:09 AM
  3. Trying to append text into a cell with different colours
    By Earl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2008, 05:23 PM
  4. Scrolling text in a Cell
    By Robert Bob in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-26-2007, 06:47 PM
  5. Replies: 4
    Last Post: 01-03-2007, 05:14 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