+ Reply to Thread
Results 1 to 10 of 10

State numbers beyond decimal point as integer

Hybrid View

  1. #1
    Registered User
    Join Date
    11-17-2009
    Location
    Pasadena, CA, USA
    MS-Off Ver
    Excel 2007
    Posts
    30

    State numbers beyond decimal point as integer

    Hello Excel friends,

    Do you know if there is any way to state the values beyond the decimal point of a given number as an integer? As an example, I have the number 1.3579 in cell A1. I would like to put a formula in cell B1 that will yield the number 3579. The number in B1 would correspond to the values beyond the decimal point of the number in A1, stated as an whole number.

    This would be easy to do manually: One would just have to delete the number(s) to the left of the decimal point and then delete the decimal point itself. However, I will be working with a lot of numbers which will be updated dynamically and quite frequently, making manual adjustments impossible.

    Would any of you Excel wizards have a suggestion on how to approach this challenge?

    Thanks so much,

    Steven

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,721

    Re: State numbers beyond decimal point as integer

    Are there always 4 decimal places or might that be variable? What about a number like 1.0003, do you want to retain the leading zeroes like 0003 or should that give you just 3?
    Audere est facere

  3. #3
    Registered User
    Join Date
    11-17-2009
    Location
    Pasadena, CA, USA
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: State numbers beyond decimal point as integer

    Quote Originally Posted by daddylonglegs View Post
    Are there always 4 decimal places or might that be variable? What about a number like 1.0003, do you want to retain the leading zeroes like 0003 or should that give you just 3?
    Good question. In the example you gave, I would be using the number 3, not 0003. I have to find the GCD of the number beyond the decimal point and 10^10. However, if there are 0s in front of the non-zero value(s) beyond the decimal, I will omit the zeros.

    Looking forward to understanding more,

    Steven

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: State numbers beyond decimal point as integer

    Hi,

    One way

    =(A1-INT(A1))*10^(LEN(A1)-FIND(".",A1))
    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Registered User
    Join Date
    11-17-2009
    Location
    Pasadena, CA, USA
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: State numbers beyond decimal point as integer

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    One way

    =(A1-INT(A1))*10^(LEN(A1)-FIND(".",A1))
    HTH

    Hi Mr. Buttrey,

    Thanks for your help! I am able to get exactly the result I had described, but my challenge perhaps not as straightforward as I intimated. I have the number -30.1415466175 listed in cell J2. I inputed your code in cell K2 and changed all the uses A1 in your code to J2. The result I'm getting in K2, however, is 8.58453E+12. What I was hoping to get was 1415466175. Do you know what I'm doing wrong?

    Thank you so much for your kind help!

    Steven
    Last edited by stevenpaul; 10-17-2010 at 08:03 PM.

  6. #6
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: State numbers beyond decimal point as integer

    So, what would be your expected results for

    1.3
    1.30
    1.03
    1.003

  7. #7
    Registered User
    Join Date
    11-17-2009
    Location
    Pasadena, CA, USA
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: State numbers beyond decimal point as integer

    Quote Originally Posted by teylyn View Post
    So, what would be your expected results for

    1.3
    1.30
    1.03
    1.003
    I am carrying out the original numbers to 10 decimal places, so the first two numbers you listed would come out as 3 with 10 zeros, the 3rd number would be 3 with 9 zeros, and the 4th number would be 3 with 8 zeros.

    Thanks,

    Steven

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,721

    Re: State numbers beyond decimal point as integer

    Perhaps try

    =MOD(ABS(J2),1)*10^10

  9. #9
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,355

    Re: State numbers beyond decimal point as integer

    Will this do?
    =(ABS(A1)-INT(ABS(A1)))*10^10

  10. #10
    Registered User
    Join Date
    11-17-2009
    Location
    Pasadena, CA, USA
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: State numbers beyond decimal point as integer

    Quote Originally Posted by MarvinP View Post
    Will this do?
    =(ABS(A1)-INT(ABS(A1)))*10^10
    Thank you very much, friends. Both your solutions, Marvin and DaddyLongLegs work perfectly!

    Steven

+ 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