+ Reply to Thread
Results 1 to 3 of 3

How to remove specfic dashes within a cell, leaving others

  1. #1
    Registered User
    Join Date
    07-28-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    1

    How to remove specfic dashes within a cell, leaving others

    I have a series of columns that have dashes in them and want to remove just specific dashes from the cell

    Example of original 70489-344-15-001

    This is what I want --> 70489-34415001


    Got about 1000 of them ...

    Thanks in advance

  2. #2
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: How to remove specfic dashes within a cell, leaving others

    Two methods:

    =TEXT(SUBSTITUTE(D2,"-",""),"00000-00000000")

    =LEFT(TRIM(SUBSTITUTE(D3,"-","")),5)&"-"&RIGHT(TRIM(SUBSTITUTE(D3,"-","")),8)


    Those will only work if the number is always going to be five digits - 8 digits though... 12345-12345678. The latter will allow you to adjust how many digits are on either side of the hyphen by replacing the bold 5 and/or 8 with another formula or cell reference.
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  3. #3
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: How to remove specfic dashes within a cell, leaving others

    If all of your starting values follow the same pattern (value has three dashes to start with, and you only want to keep the first one), try:

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

    If you have more than three dashes this will require adjustment.

+ 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. [SOLVED] Remove items from cell, leaving formatting intact.
    By staggers47 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-08-2022, 09:32 AM
  2. Replies: 3
    Last Post: 01-17-2014, 08:08 PM
  3. Replies: 8
    Last Post: 12-04-2013, 12:49 PM
  4. [SOLVED] Remove If Statement From Cell Leaving [Value_If_False] From Formula
    By dopeybob435 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-20-2013, 05:53 PM
  5. Remove dashes
    By beth18 in forum Excel General
    Replies: 4
    Last Post: 02-21-2011, 05:38 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