+ Reply to Thread
Results 1 to 8 of 8

Delete all characters after last numeric

  1. #1
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,718

    Delete all characters after last numeric

    This have on a1

    CL712BG
    CL712BG
    CL712BG
    CL712BG
    CL712BG
    CL712BR
    CL712BR
    CL712BR
    CL712BR
    CL712BR

    Want

    CL712
    CL712
    CL712
    CL712
    CL712
    CL712
    CL712
    CL712
    CL712
    CL712

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Delete all characters after last numeric

    Is that a consistent format?

    You could just do
    =LEFT(A1,5)

  3. #3
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2013 PRO PLUS
    Posts
    3,718

    Re: Delete all characters after last numeric

    This may not work as character could not be same

  4. #4
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Delete all characters after last numeric

    Hi All,

    a possible formula:

    =LEFT(A1,MAX(INDEX(ISNUMBER(--MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))*ROW(INDIRECT("1:"&LEN(A1))),0)))

    Hope it helps
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Delete all characters after last numeric

    Can you give a more complete sample set of data, that shows all possible formats?

  6. #6
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Delete all characters after last numeric

    =iferror(left(a1,lookup(2,1/(mid(a1,row(indirect("1:"&len(a1))),1)),row(indirect("1:"&len(a1))))),a1)
    Please Login or Register  to view this content.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Delete all characters after last numeric

    Assumes every cell will contain a single string of digits.

    =LEFT(A1,LOOKUP(10,--MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1),ROW(INDIRECT("1:"&LEN(A1)))))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,658

    Re: Delete all characters after last numeric

    In general, (for any cases with mixture of values and strings, i think)

    =LEFT(A1,LEN(A1)+1-MATCH(TRUE,ISNUMBER(--MID(A1,LEN(A1)-ROW(INDIRECT("1:"&LEN(A1)))+1,1)),0))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    Quang PT

+ 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] Pull first numeric characters
    By makinmomb in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-09-2015, 04:07 AM
  2. [SOLVED] VBA Code for Textbox: First 3 characters Alphabets next 3 characters numeric
    By honger in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-11-2013, 01:05 AM
  3. [SOLVED] Sum of numeric values within cells also containing non-numeric characters
    By Mike Brewer in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 04-24-2013, 09:16 AM
  4. [SOLVED] Delete characters and add * in front and last characters in ACCESS QUERY
    By LALTIZER in forum Access Tables & Databases
    Replies: 9
    Last Post: 02-01-2013, 02:06 PM
  5. Catch non-numeric characters
    By PerdixDaedalus in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-12-2013, 04:50 AM
  6. Delete all non-numeric characters?
    By Elegidos in forum Word Programming / VBA / Macros
    Replies: 6
    Last Post: 10-09-2009, 11:40 AM
  7. [SOLVED] Converting numeric characters
    By Demmaus in forum Excel General
    Replies: 2
    Last Post: 07-15-2005, 07:05 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