1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Decimal points in Excel formulas

Discussion in 'Other PC Software' started by TheDirtyOne, 2004/02/27.

Thread Status:
Not open for further replies.
  1. 2004/02/27
    TheDirtyOne

    TheDirtyOne Inactive Thread Starter

    Joined:
    2002/02/14
    Messages:
    50
    Likes Received:
    0
    I have several Excel spreadsheets that I use currency formulas in. Since it's currency, I always have the result shown only to the 2nd decimal place (i.e. $200.75)

    My problem is:
    Since my formulas use percentages and currency, I can't get the numbers to add up correctly when I SUM a column or row. Sometimes it's correct and sometimes it's 1 cent off. I know why it's doing it. Here's a sample formula:

    Cell A1: 453 (result shown: $453.00)
    Cell A2: =A1*0.0145 (result shown: $6.57)
    Cell A3: =A1*0.065 (result shown: $29.45)
    Cell A4: =SUM(A2:A3) (result shown: $36.01)

    The SUM formula adds it up to $36.01, but if you get a calculator and add 6.57+29.45 it equals 36.02. It's doing it because the percentage formulas (A2 and A3) have like 3 or 4 actual decimal places in them (i.e. 453 x 0.0145 actually equals 6.5685, not 6.57)

    So, when the SUM adds them up, it's not adding 6.57+29.45, but 6.5685+29.445 and therefore comes up with 36.01.

    My question is:
    Is there a way to make the SUM formula add the values shown (i.e. 6.57 and 29.45) instead of the actual decimal values? When dealing with accounting the numbers HAVE to add up. And, if I can't use formulas (because it won't add correctly) then that makes my work that much harder.

    Any help is GREATLY appreciated!
     
  2. 2004/02/27
    Newt

    Newt Inactive

    Joined:
    2002/01/07
    Messages:
    10,974
    Likes Received:
    2
    I always have the result shown only to the 2nd decimal place (i.e. $200.75)

    There's your problem. You need the result truncated to that value - or rounded although if you are dealing purely with currency I'm not sure how you are getting numbers past the 2nd decimal place.

    If they are not significant, then truncating is the way to go.

    Play around with both TRUNC and ROUND to see how they behave. For example, assume I have the value 123.436 in cell A1.

    =TRUNC(A1,0) would give 123.00
    =TRUNC(A1,2) would give 123.43
    =ROUND(A1,0) would give 123.00
    =ROUND(A1,2) would give 123.44
     
    Newt,
    #2

  3. to hide this advert.

  4. 2004/02/28
    TheDirtyOne

    TheDirtyOne Inactive Thread Starter

    Joined:
    2002/02/14
    Messages:
    50
    Likes Received:
    0
    Thanks Newt! The TRUNC function is doing the trick.
     
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.