+ Reply to Thread
Results 1 to 9 of 9

Excel 2007 : How to get the SUM of displayed Cell values, not of their calculated results ?

  1. #1
    Registered User
    Join Date
    06-11-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    3

    How to get the SUM of displayed Cell values, not of their calculated results ?

    I've used Excel in a superficial way for years - mostly for financial tasks. If I define the Format of a range of calculated cells as Numeric with 2 decimals [ being monetary ] why does SUM give me a Total of the calculated values, not the sum of values displayed as I have specified ? I trawled the Help and tried TRUNCATE but got nowhere.

  2. #2
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: How to get the SUM of displayed Cell values, not of their calculated results ?

    Hi Motspur,

    If you're talking about showing the values displayed when you filter the data, it will be because that's not what =SUM() is for.

    Try using =SUBTOTAL() instead.

    For example, if your list of monetary values are in cells E2 to E12, enter the formula =SUBTOTAL(9,E2:E12) in cell E13 and then filter the data as required.

    If that's not at all what you meant, you'll need to provide more details and possible a dummy workbook to better explain your query.
    If I've been of help, please hit the star

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: How to get the SUM of displayed Cell values, not of their calculated results ?

    The range of numbers has been 'formatted' as 2 decimals but the actual values have more than 2. The SUM() function is summing the actual values. If you want SUM() to reflect what is being shown then instead of formatting to 2 decimals use ROUND() or TRUNC() or any other such treatment of the actual values. If your values are derived from formulas just put the formulas within the ROUND() function.

  4. #4
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,881

    Re: How to get the SUM of displayed Cell values, not of their calculated results ?

    Hi Motspur, welcome to the forum.

    There is another option, but I would caution against its use: Set Precision as Displayed (Excel Options > Advanced > When calculating this workbook section). By checking that option, all values, including those derived from formulae, will be converted to the display format.

    If you have a formula that results in 0.33333, but the cell is formatted to only show two decimal places, the cell value/formula result will change to 0.33 and any formulas that depend on that cell will use 0.33 as the value. Once you set precision as displayed it applies to all values in the workbook and cannot be reversed (unless you have a backup copy of the workbook prior to making the change).

    You can probably see how this could get messy if you work with large numbers and accuracy is vital.

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: How to get the SUM of displayed Cell values, not of their calculated results ?

    That's why I didn't suggest it.

  6. #6
    Registered User
    Join Date
    06-11-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to get the SUM of displayed Cell values, not of their calculated results ?

    Quote Originally Posted by Cutter View Post
    The range of numbers has been 'formatted' as 2 decimals but the actual values have more than 2. The SUM() function is summing the actual values. If you want SUM() to reflect what is being shown then instead of formatting to 2 decimals use ROUND() or TRUNC() or any other such treatment of the actual values. If your values are derived from formulas just put the formulas within the ROUND() function.
    Hello CutterBugReport20120611_ExcelSUMvROUND.xlsx and thanks for your Input. However, as I tried to make clear my Excel knowledge is only rudimentary and Iím not sure that Iím getting the whole message. If you examine the example Spreadsheet, Row 26 is defined with SUM as Iíve always done but gets a misleading Total in O26. Certainly [ thanks to you ], I can insert a separate Row [ 27 ] and use ROUND to get the correct Total in O27 but is there really no simpler, direct way ?

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: How to get the SUM of displayed Cell values, not of their calculated results ?

    You need this in C26 and dragged across:

    =ROUND((C68+C70)/2*C71,2)

    note that the SUM(C68+C70) is now just (C68+C70) - that SUM was redundant - use either (C68+C70) or SUM(C68,C70)

  8. #8
    Registered User
    Join Date
    06-11-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to get the SUM of displayed Cell values, not of their calculated results ?

    Hello again Cutter and thanks for a comprehensive solution, succinctly explained.

  9. #9
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: How to get the SUM of displayed Cell values, not of their calculated results ?

    You're welcome. If your problem has been resolved please mark your thread as SOLVED (click on Forum Rules @ top of page and see rule #9 for instructions, if needed).

    And thanks for the 'star tap'.
    Last edited by Cutter; 06-15-2012 at 08:53 AM.

+ 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