+ Reply to Thread
Results 1 to 4 of 4

Remove repeating characters (like dashes in a MAC address value)

  1. #1
    Registered User
    Join Date
    05-30-2012
    Location
    Anchorage Alaska
    MS-Off Ver
    Excel 2010
    Posts
    2

    Remove repeating characters (like dashes in a MAC address value)

    Is there a quick/easy formula that could replace every instance of a specific character with another value, reguardless of the number of times it appears in a cell?

    Example I want to turn the following computer MAC address: "78-45-D1-D3-BB-00" into "7845D1D3BB00" so I can compare it to values from another datasource.

    I started to write the following formula and got a headache... =LEFT(A2,FIND("-",A2)-1)&MID(A2,FIND("-",A2,2)+1,2)........

    NOTE: I am trying to do this without using the Excel FIND & REPLACE (<CTRL> + H)

    Thanks! Tony

  2. #2
    Registered User
    Join Date
    08-21-2011
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Remove repeating characters (like dashes in a MAC address value)

    Use SUBSTITUTE,

    =SUBSTITUTE(A1,"-","")

    Where A1 contains your text

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Remove repeating characters (like dashes in a MAC address value)

    Use SUBSTITUTE replacing "-" with "". You can nest the function if there are other characters to be replaced.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    05-30-2012
    Location
    Anchorage Alaska
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Remove repeating characters (like dashes in a MAC address value)

    Quote Originally Posted by Only4Excel View Post
    Use SUBSTITUTE,

    =SUBSTITUTE(A1,"-","")

    Where A1 contains your text
    There it is! I totally forgot, couldn't remember and find! Thanks Only!

+ 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.6.0 RC 1