+ Reply to Thread
Results 1 to 9 of 9

Remove Leading zero's up to the point of a positive number

  1. #1
    Registered User
    Join Date
    09-11-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    53

    Remove Leading zero's up to the point of a positive number

    If I have a column with various numbers containing leading zero's (of different length), how can I get these leading zero's removed without removing any further zero's thereafter the first positive number in the cell

    example

    0000012340
    0000006500
    0007896541

    I want these three cells to display as...

    12340
    6500
    7896541

    I can find no combination of =MID, Find and replace or =RIGHT that can do this for me

    Please help

    Regards
    Matt

  2. #2
    Forum Contributor
    Join Date
    01-28-2014
    Location
    Turkey
    MS-Off Ver
    Excel 2013
    Posts
    159

    Re: Remove Leading zero's up to the point of a positive number

    Maybe

    Please Login or Register  to view this content.

  3. #3
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Remove Leading zero's up to the point of a positive number

    Hi, Just add 0 to all the entries..

    So if those 3 Values are in Cells A1:A3, in B1, use =A1+0 and drag down..
    Cheers!
    Deep Dave

  4. #4
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Remove Leading zero's up to the point of a positive number

    If you do not wish to use a formula, on a blank cell enter 0 > copy that cell > Select the range on numbers with leading Zeros > Use Ctrl+Alt+V & V again > Select Add > Click On OK..

    Cheers!

  5. #5
    Registered User
    Join Date
    09-11-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    53

    Re: Remove Leading zero's up to the point of a positive number

    Thanks msexcelathome

    Your later example works. It would be handy to have a formula that could do the same thing. I may just resort to a macro if not.

    Cheers

  6. #6
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Remove Leading zero's up to the point of a positive number

    @ mattc_uk

    Hi, there is no reason the 1st one should not work..

    Can you attach a sample workbook where I can give you the solution?

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: Remove Leading zero's up to the point of a positive number

    You have a formula in Post #3

    Pete

  8. #8
    Registered User
    Join Date
    09-11-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    53

    Re: Remove Leading zero's up to the point of a positive number

    I've cracked it with an easier formula

    The numbers I was getting were from part of a cell from another sheet (using an =MID statement). As I was already using an =MID all I had to do was bracket is and add -0) to the end ! So Simple!

    Example

    =(MID(Sheet1!A1:A500))-0

  9. #9
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Remove Leading zero's up to the point of a positive number

    Just a tip, whenever a formula returns numbers that are really text, but look like numbers, all you have to do is perform any sort of mathematical calculation over it to convert it back to numbers.. Like you did, subtracting 0..

    Adding 0, Subtracting 0, Multiplying by 1, will all do the same thing..

    Cheers!

+ 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. Scroll bar with a mid point of 0 and positive increasing values on both ends
    By jasonleewkd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2014, 06:21 AM
  2. Replies: 2
    Last Post: 04-22-2013, 07:34 AM
  3. formatting with leading zero and point in value
    By JohanB in forum Excel General
    Replies: 6
    Last Post: 08-25-2009, 05:19 AM
  4. Remove Leading Spaces
    By edwardpestian in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-22-2006, 10:34 AM
  5. Replies: 3
    Last Post: 03-18-2006, 02:25 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