+ Reply to Thread
Results 1 to 6 of 6

Best way to remove a number at the end of a name?

  1. #1
    Forum Contributor
    Join Date
    03-08-2011
    Location
    Lubbock, TX, USA
    MS-Off Ver
    MS OFFICE 365 EXCEL, OUTLOOK, WORD, POWERPOINT
    Posts
    194

    Best way to remove a number at the end of a name?

    When I import performance data I get a column that is a mashup of the work order and the tech name.

    8080222222 -Boliver.Shagglenasty
    8236541245 -Boliver.Shagglenasty
    2589764318 -Boliver.Shagglenasty1
    9371824679 -Boliver.Shagglenasty1
    7193824613 -Boliver.Shagglenasty2

    I don't need the wo # but I do need the name.

    I use
    Please Login or Register  to view this content.
    to isolate the name. The 19 is the actual number but won't look right with the above because I changed up the WO numbers to avoid any issues with proprietary info.

    Then I have an automated find/repl that gets the period out and replaces it with a space.

    Please Login or Register  to view this content.
    Usually I'm good. But, the source data sometimes has a numeric attachment as shown above. My method doesn't see or remove that. When I roll up name-based data the numerics are not counted since they don't match the other name.

    I need to fix it so that any numeral(s) at the end is/are removed. And right now I am drawing a blank.

    Any ideas? Any discussion welcomed. No idea is too crazy. Thanks for reading everyone.

  2. #2
    Valued Forum Contributor
    Join Date
    04-24-2020
    Location
    Woodbridge, VA
    MS-Off Ver
    2016
    Posts
    434

    Re: Best way to remove a number at the end of a name?

    Have you tried Text to columns to separate the work order number, name and number at the end?

  3. #3
    Valued Forum Contributor
    Join Date
    04-24-2020
    Location
    Woodbridge, VA
    MS-Off Ver
    2016
    Posts
    434

    Re: Best way to remove a number at the end of a name?

    Go to the Data tab
    Click on Text to Columns
    Select Fixed Width

    Adjust the lines accordingly then hit Finish.

    Results are like this
    Attached Images Attached Images
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Best way to remove a number at the end of a name?

    Well, here's an ugly formula, but it doesn't matter if there are any numbers after the name or not, nor does it care how many digits are after the name.
    It does assume that the name always starts at the 13 character. If that's not true, more formula can be added to handle that as well. (This formula assumes your data is in cell A1.

    =TRIM(LEFT(SUBSTITUTE(TRIM(MID(A1,13,500)),"."," "),MIN(FIND({0,1,2,3,4,5,6,7,8,9},SUBSTITUTE(TRIM(MID(A1,13,500)),"."," ")&" 0123456789"))-1))

  5. #5
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,150

    Re: Best way to remove a number at the end of a name?

    If you want to use VBA, select the range with your mouse and run the below code;

    Please Login or Register  to view this content.

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Best way to remove a number at the end of a name?

    Please try

    =MID(LEFT(A2,LEN(A2)+1-MATCH(1,INDEX(-RIGHT(A2&0,{1,2}),))),FIND("-",A2)+1,50)

+ 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 phone number in cells that contains string and number
    By farisnaufghas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-07-2018, 07:49 PM
  2. Detect and remove phone number in cells that contains string and number
    By farisnaufghas in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-07-2018, 05:34 PM
  3. Replies: 3
    Last Post: 08-12-2014, 06:26 PM
  4. VBA to remove formulas from specific number columns (number changes each week)
    By DKerr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2013, 06:41 AM
  5. Need to remove number and decimal from before number
    By NHeritage61 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-10-2013, 04:53 PM
  6. [SOLVED] Remove 0 and - From Number
    By waqarqrl in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-06-2012, 10:05 AM
  7. remove cr character from a + number and change number to - 159cr
    By Cr character on numbers in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-10-2006, 06:40 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