+ Reply to Thread
Results 1 to 4 of 4

Formula to show only first two digits?

  1. #1
    Registered User
    Join Date
    10-19-2004
    Posts
    79

    Formula to show only first two digits?

    Hi all,
    I have a list of numbers and want to make a formula to display the first two digits.
    For example I am using =LEFT(D4,1+1) on the number 0102 and I get 10
    Whatever I do I cannot get it to recognise the 0
    Can someone please help
    Thanks
    legepe
    Last edited by NBVC; 05-29-2010 at 09:46 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula to show only first two digits?

    Are you sure it is not just that cell D4 is formatted as something like 0000?

    If you select D4 and look in the formula bar, you will see probably 102.

    So it is really a 3 digit number...

    Maybe you can use: =TEXT(LEFT(D4,IF(LEN(D4)=3,1,2)),"00")

    or

    =LEFT(TEXT(D4,"0000"),2)
    Last edited by NBVC; 05-29-2010 at 01:27 PM.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Formula to show only first two digits?

    deleted:-------------------
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  4. #4
    Registered User
    Join Date
    10-19-2004
    Posts
    79

    Re: Formula to show only first two digits?

    Thanks for the quick reply, your first formula worked fine... and as you said it was a 3 digit number...
    Any way thanks again
    legepe

+ 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