+ Reply to Thread
Results 1 to 5 of 5

Thread: insert a hyphen between alpha and numeric in the same cell

  1. #1
    Registered User
    Join Date
    01-21-2012
    Location
    Utah
    MS-Off Ver
    2010
    Posts
    3

    insert a hyphen between alpha and numeric in the same cell

    Hello,
    My vendors send me files with alphanumeric part numbers.
    Is there a way to quickly insert a hyphen between the alpha and the number? Here are some examples:

    The vendors worksheet reads: I would like it to read:
    AR11A AR-11-A
    SBK870T SBK-870-T
    MBPT-123AB MBPT-123-AB

    If anyone could help me with this I would appreciate it.

    Thank You,
    JS Peterson
    Last edited by jspeterson; 02-09-2012 at 08:53 PM.

  2. #2
    Valued Forum Contributor tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    USA
    MS-Off Ver
    Excel 2003 - 2007
    Posts
    2,352

    Re: insert a hyphen between alpha and numeric in the same cell

    jspeterson,

    Is it always in the format of 'group of letters' - 'group of numbers' - group of letters'?
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Guru Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    5,590

    Re: insert a hyphen between alpha and numeric in the same cell

    Try this in B2, assuming your data is in A2 down
    =SUBSTITUTE(A2,LOOKUP(99^99,--("0"&MID(A2,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A2&"0123456789")),ROW($1:$10000)))),"-"&LOOKUP(99^99,--("0"&MID(A2,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A2&"0123456789")),ROW($1:$10000)))) &"-")
    Drag/Fill Down.
    If you need any more information, please feel free to ask.

    However, if this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
    Also
    If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.

  4. #4
    Registered User
    Join Date
    01-21-2012
    Location
    Utah
    MS-Off Ver
    2010
    Posts
    3

    Re: insert a hyphen between alpha and numeric in the same cell

    Hello tigeravatar,
    Marcol answered my question. Thank you very much for your reply.
    JSPeterson

  5. #5
    Registered User
    Join Date
    01-21-2012
    Location
    Utah
    MS-Off Ver
    2010
    Posts
    3

    Re: insert a hyphen between alpha and numeric in the same cell

    Hello Marcol,
    That worked perfectly.
    Thank You very much for your help.
    JSPeterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0