+ Reply to Thread
Results 1 to 9 of 9

Delete all Zeroes and keep letters and Numbers

  1. #1
    Registered User
    Join Date
    11-14-2016
    Location
    usa,CA
    MS-Off Ver
    2010
    Posts
    20

    Delete all Zeroes and keep letters and Numbers

    I am trying to take out "00" from RIGHT side and cant think of any formulas. Please help.


    Original Data
    10210000
    10360000
    11002025

    With this Formula it works : =IF(RIGHT(E2,4)="0000",LEFT(E2,LEN(E2)-4),E2)

    Results:
    1021
    1036
    11002025

    However, when my data starts with Letter and zeroes from the beginning such as:

    00A0660000 formula above give me "00A066", so how to keep the above formula and also have this one as of "A066".

    Will really appreciate your help on that.

    Thank you so much

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Delete all Zeroes and keep letters and Numbers

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Contributor
    Join Date
    12-18-2016
    Location
    London
    MS-Off Ver
    Microsoft 2013
    Posts
    145

    Re: Delete all Zeroes and keep letters and Numbers

    Try this formula, hope this will help:
    =SUBSTITUTE(TRIM(SUBSTITUTE(A1,"0"," "))," ","0")

  4. #4
    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 Zeroes and keep letters and Numbers

    One way...

    Data Range
    A
    B
    1
    10210000
    1021
    2
    10360000
    1036
    3
    11002025
    11002025
    4
    00A0660000
    00A066
    5
    10
    1
    6
    Data
    Data


    This formula entered in B1 and copied down:

    =LEFT(A1,LOOKUP(2,1/(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)<>"0"),ROW(INDIRECT("1:"&LEN(A1)))))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    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 Zeroes and keep letters and Numbers

    Quote Originally Posted by minayat View Post

    However, when my data starts with Letter and zeroes from the beginning such as:

    00A0660000 formula above give me "00A066", so how to keep the above formula and also have this one as of "A066".
    Does that mean you want to strip off BOTH leading AND trailing zeros?

    How about posting more examples and show us what results you expect.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,320

    Re: Delete all Zeroes and keep letters and Numbers

    Try

    =IF(RIGHT(A1,4)="0000",SUBSTITUTE(LEFT(A1,LEN(A1)-4),"00",""),A1)

  7. #7
    Registered User
    Join Date
    11-14-2016
    Location
    usa,CA
    MS-Off Ver
    2010
    Posts
    20

    Re: Delete all Zeroes and keep letters and Numbers

    Prompt John...it works thank you so much.

  8. #8
    Registered User
    Join Date
    11-14-2016
    Location
    usa,CA
    MS-Off Ver
    2010
    Posts
    20

    Re: Delete all Zeroes and keep letters and Numbers

    Thanks for your help.

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,320

    Re: Delete all Zeroes and keep letters and Numbers

    You're welcome.

+ 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] leading zeroes Telephone numbers
    By databasef in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-21-2015, 09:40 AM
  2. [SOLVED] Macro to create csv file delete leading zeroes
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-20-2015, 04:40 AM
  3. Replies: 13
    Last Post: 07-30-2014, 12:03 PM
  4. [SOLVED] Find and Delete all letters & leave numbers
    By Patish in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-06-2013, 08:11 AM
  5. Replies: 2
    Last Post: 12-01-2010, 02:29 PM
  6. Delete rows with zeroes
    By maxthebear in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-13-2009, 06:18 PM
  7. [SOLVED] HOW DO MAKE ZEROES DISAPPEAR WHEN THERE ARE NO NUMBERS TO SUM
    By tazman2168 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-10-2005, 09:00 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