+ Reply to Thread
Results 1 to 6 of 6

Want to separate number and decimal. After need to sum of number & decimal.

  1. #1
    Registered User
    Join Date
    02-26-2014
    Location
    Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    3

    Want to separate number and decimal. After need to sum of number & decimal.

    Hi,

    I want to separate number and decimal. After that need the sum of number & decimal.

    Used the formula (suppose cell value A1 = 10.3 in general format)
    Number Cell B1 = INT(A1)
    Decimal Cell C1 = MOD(A1,2) * 10 >>> To make the decimal to number multiply by 10

    Cell D1 = B1+C1 <<Answer is 13>>

    Problem starts when I put the value in cell A1 as 10.30, it gives me the same answer of 10.3. But I want the answer should be 10+30 = 40.

    I can't change the format to number due to some reasons.

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Want to separate number and decimal. After need to sum of number & decimal.

    May this


    in B1

    =INT(A1)

    in C1

    =MOD(A1,1)*100

    in D1

    =SUM(B1,C1)

    A
    B
    C
    D
    1
    10.3
    10
    30
    40



    if you want this in one formula

    =SUM(INT(A1),MOD(A1,1)*100)
    Last edited by AlKey; 03-01-2014 at 03:00 PM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Want to separate number and decimal. After need to sum of number & decimal.

    or you can try below in B1 to get the sum
    =SUMPRODUCT(--(MID(SUBSTITUTE("."&A1,".",REPT(" ",250)),250*ROW(INDIRECT("1:"&(LEN(A1)-LEN(SUBSTITUTE(A1,".","")))+1)),250)))
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  4. #4
    Registered User
    Join Date
    02-26-2014
    Location
    Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Want to separate number and decimal. After need to sum of number & decimal.

    Thanks Hemesh

    Its working now

    Quote Originally Posted by hemesh View Post
    or you can try below in B1 to get the sum
    =SUMPRODUCT(--(MID(SUBSTITUTE("."&A1,".",REPT(" ",250)),250*ROW(INDIRECT("1:"&(LEN(A1)-LEN(SUBSTITUTE(A1,".","")))+1)),250)))

  5. #5
    Registered User
    Join Date
    02-26-2014
    Location
    Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Want to separate number and decimal. After need to sum of number & decimal.

    Hemesh,

    One small query in this....

    I want to multiply the integer value by 12 (i.e., if value is 4.10 then answer should be = (4*12)+10 = 58)

    Can you help on this.

  6. #6
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Want to separate number and decimal. After need to sum of number & decimal.

    if you have one decimal point in you cell then try below
    =(LEFT(A1,FIND(".",A1)-1)+0)*12+(RIGHT(A1,LEN(A1)-FIND(".",A1))*10)

    for multiple decimals like
    10.12.15.1897.123.15874 you can use earlier one

+ 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] copy number with 3 or more decimal places and paste the actual value as 2 decimal number
    By k1dr0ck in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-29-2013, 12:57 AM
  2. Replies: 2
    Last Post: 06-29-2012, 07:52 PM
  3. Paste two decimal number in excel without extra decimal places appearing
    By jeffery_frick in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-13-2009, 07:49 PM
  4. Replies: 3
    Last Post: 03-18-2006, 02:25 PM
  5. How to convert a decimal number to a non-decimal number?
    By snickers22 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-13-2005, 07:06 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