+ Reply to Thread
Results 1 to 10 of 10

Formula/Code to remove first 3 numbers and dash

  1. #1
    Forum Contributor Legend Rubber's Avatar
    Join Date
    09-21-2012
    Location
    Tillsonburg, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    392

    Formula/Code to remove first 3 numbers and dash

    I have 550 cells that contain varied numbers in the same format as phone numbers... ###-###-####

    I would like to remove the first ###-

    Is this doable easy??
    Last edited by Legend Rubber; 07-17-2015 at 09:31 AM.

  2. #2
    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,711

    Re: Formula/Code to remove first 3 numbers and dash

    One way, for data in cell A1:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    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


  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,258

    Re: Formula/Code to remove first 3 numbers and dash

    Try this...
    =MID(A1,FIND("-",A1)+1,255)
    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

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

    Re: Formula/Code to remove first 3 numbers and dash

    Other variations on a theme:

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

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



    Regards, TMS

  5. #5
    Forum Contributor Legend Rubber's Avatar
    Join Date
    09-21-2012
    Location
    Tillsonburg, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    392

    Re: Formula/Code to remove first 3 numbers and dash

    Please Login or Register  to view this content.
    This worked great, but can it be adapted to also remove the last -####? So that only the middle 3 numbers are left? so for example 123-456-7891 would turn to 456?

  6. #6
    Forum Contributor Legend Rubber's Avatar
    Join Date
    09-21-2012
    Location
    Tillsonburg, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    392

    Re: Formula/Code to remove first 3 numbers and dash

    also there is sometimes more numbers after those four... it could be 123-456-7891.36524 or something... so if it could be that EVERYTHING after the last "-" is removed as well...

  7. #7
    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,711

    Re: Formula/Code to remove first 3 numbers and dash

    Kinda moving the goal posts a little, no?

    You have been given 4 possible approaches to address the original question.

    Maybe you should have a think about all the variations you might encounter and come back with a sample workbook that solutions can be tested on.

    If you just want the 8 digits after the first hyphen and the structure of the data is consistent ... 3 digits hyphen 3 digits hyphen lots of digits ... then modify one of the MID formula already provided.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor Legend Rubber's Avatar
    Join Date
    09-21-2012
    Location
    Tillsonburg, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    392

    Re: Formula/Code to remove first 3 numbers and dash

    ya thanks... i am sorry, i didn't realize we weren't allowed to alter our request after original post.

    This is for two separate scenarios... i am already using the original solution in my first workbook, and then the idea came to use it in another place on a second workbook...

    Unfortunately i do not know a lot about excel, and i did not think of using the second scenario until i put the first in place...

    Thanks for all your help.

    P.S. Manchester is a sweet place, went there on my last trip to England. The tunnels where especially interesting.

  9. #9
    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,711

    Re: Formula/Code to remove first 3 numbers and dash

    No problem. It's not so much that you can't change your request, more a case of avoiding "scope creep" where the requirements change and evolve as each question is answered.

    The best approach is, when the original question is answered, mark it solved and draw a line under. Start a new thread with the new question/variation and, if it is appropriate, provide a link back to the earlier question for reference. That way, you get more/new people looking at your question and they can benefit from the solution(s) already provided.

    With regard to the tunnels, I've lived here all my life and never been down those tunnels. Unfortunately, tours are currently suspended or it might have prompted me to go. We very recently visited London and went on a tour of the "Lost Rivers of London". In this case, following the route of the River Fleet. Very interesting, in some senses, but more a walk round the back streets of London looking at grids (drains). Oh, and the highlight being the Travel Lodges of London . Still, it wasn't expensive

    Regards, TMS

  10. #10
    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,711

    Re: Formula/Code to remove first 3 numbers and dash

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. Remove dash (-) that resides between numbers in a SSN
    By wheatgrass in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-02-2012, 08:21 AM
  2. Remove dash from Date
    By mma3824 in forum Excel General
    Replies: 1
    Last Post: 10-30-2012, 07:04 AM
  3. Replies: 3
    Last Post: 11-06-2011, 01:49 PM
  4. remove the dash
    By sigdig in forum Excel General
    Replies: 3
    Last Post: 10-24-2006, 12:13 AM
  5. [SOLVED] Remove dash(s)
    By Pierre in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-14-2006, 11:00 PM
  6. remove a dash from part numbers
    By Mr Happy in forum Excel General
    Replies: 3
    Last Post: 05-25-2006, 04:10 PM
  7. Remove dash in cell
    By dyukon in forum Excel General
    Replies: 3
    Last Post: 01-19-2006, 12:50 PM
  8. understanding dash dash in a excel formula
    By ldebner in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-31-2005, 10:05 AM

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