+ Reply to Thread
Results 1 to 4 of 4

Delete leading zeros

  1. #1
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Delete leading zeros

    Dear All,

    I hope you are all well.

    I have a cell (let's say cell L19) where I have a number as following:

    0020079747 0000009857 2013

    This number is taken from an internal system. What I need is a formula in Cell "K19" that populates only the following number: 9857 2013

    Now, on some cases, where is the number "9857" (4 digits on this example), could have more numbers (e.g. 0020079747 0000078952 2013).

    I am oly using this formula: "=MID(L19,12,15)" but this returns the leading zeros "0000009857 2013".

    By any chance, anyone knows some formula or function?

    You help will be highly appreciated.

    Best regards,
    Filipe Oliveira

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Delete leading zeros

    =MID(L19,12,10)+0&" "&RIGHT(L19,4) maybe
    or
    =MID(L19,12,10)+0&RIGHT(L19,5)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Delete leading zeros

    hi pipoliveira. assuming length always different but always in sets of 3 numbers:
    =MID(L19,FIND(" ",L19)+1,FIND(" ",L19,FIND(" ",L19)+1)-FIND(" ",L19)-1)+0&MID(L19,FIND(" ",L19,FIND(" ",L19,FIND(" ",L19)+1)),255)

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Forum Contributor pipoliveira's Avatar
    Join Date
    08-09-2012
    Location
    Ireland
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    368

    Re: Delete leading zeros

    Thanks for your replies guys.

    Both of you had the same results.

    Sorry Benishiryo, but I used the formula from Martindwilson as it's shorter

    Once again, thanks a million to both of you.

    Really appreciated.

    Best regards,
    Filipe Oliveira.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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