+ Reply to Thread
Results 1 to 9 of 9

Sum Function error with re-located sheets in workbook.

  1. #1
    Registered User
    Join Date
    11-18-2008
    Location
    New Zealand
    Posts
    6

    Sum Function error with re-located sheets in workbook.

    In a spreadsheet there are potential differences between using two forms of aggregation formula:

    ='BLD 1'!D3+'BLD 2'!D3+'BLD 3'!D3 ... +'BLD 11'!D3 created by selecting the nominated cell in successive tabbed sheets

    or

    =SUM('BLD 1 :BLD 11!D3') created types =Sum( in the target cell and selecting the nominated cell in the first sheet in the series, and then, holding down the Shift key, selecting the nominated cell in the last sheet in the series, adding the cell reference to the formula and closing the parentheses.

    The first form will always total the values in ALL the nominated cells. But creating the formula in workbooks with many sheets can be a pain.

    In the second form, the total may not be the same IF there are any changes to the order in which the sheets series was created.

    The second form of the formula depends on the internal sheet numbers of the series assigned as the sheets are created.

    If Sheet 11 is moved to precede Sheet 9, the second form will NOT include Sheet 9 or Sheet 10 as the formula recognised the internal sheet No. 11 as the last item in the series.

    THIS HAS A REAL POTENTIAL FOR DISASTER, particularly where there is no obvious way of cross checking the integrity of the summation.

    As this circumstance must have occurred many times, I suspect there is a work around or some other procedure to eliminate this potential hazard is spreadsheets. IT is a TRAP for the innocent who assume the formula will do as apparently instructed.

    You can view the internal names by opening the VBA editor and looking in the properties box. This will immediately disclose any change in order. Re-locating the tabbed sheets into the original order will solve the problem. But HOW DO YOU KNOW a problem exists?

    Suggestion or solutions would be welcomed.
    Last edited by VBA Noob; 11-19-2008 at 04:22 AM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Welcome to the forum.

    The easy way is to insert two blank bookend sheets (say, Left and Right) and use =sum(Left:Right!D3)
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    11-18-2008
    Location
    New Zealand
    Posts
    6
    Tks for tip.

    However, this solution does nothing to warn the uninitiated or the nomice.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Uninitiated novices shouldn't be making changes to workbooks when errors can have DISASTROUS consequences.

  5. #5
    Registered User
    Join Date
    11-18-2008
    Location
    New Zealand
    Posts
    6
    shg

    Your admonition about uninitiated novices is both unseemly and unhelpful.

    Novices are entitled to expect that correctly entered formula work as intended, and are not going to be prostituted by undisclosed quirks of the program.

    My view is that this aspect of Excel does not recognise that end users will almost certainly re-order worksheets, and that this should not induced un-warned errors.

    I regard this quirk as a program failure.

  6. #6
    Registered User
    Join Date
    11-18-2008
    Location
    New Zealand
    Posts
    6
    PS : I meant to thank you again for the tip which I found helpful.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Your admonition about uninitiated novices is both unseemly and unhelpful.
    lrollo, you brought them into the conversation.

    EDIT: It ocurrs to me that you took the remark as directed at you; it wasn't. I assumed your reference was to other people who use workbooks you create. Please accept my apology for speaking carelessly.

    Novices are entitled to expect that correctly entered formula work as intended ...
    And they will be fully rewarded by Excel in that regard.
    ... and are not going to be prostituted by undisclosed quirks of the program. I regard this quirk as a program failure.
    One man's quirk is another's intent, and the behavior is 'undisclosed' only to those who choose not to learn how the program works.

    Worksheet and workbook protection offers a means of reducing the likelihood of people who don't know what they're doing causing problems.
    Last edited by shg; 11-18-2008 at 11:53 PM.

  8. #8
    Registered User
    Join Date
    11-18-2008
    Location
    New Zealand
    Posts
    6
    shg:

    I've tried your suggestion of adding a bookend sheets, but it did not overcome the problem.

    However, the exchange here, and from another source, has alerted me to the ways to check if a problem is likely by checking the original sheet order in VBA, and thus able to take the necessary steps to ensure that the preferred form of the formula gives a correct total.

    We will continue to differ on what a novice might expect from the program.

    Perhaps we could close this exchange by your telling what the accepted Excel definition is for the formula in the
    =SUM('BLD 1 :BLD 11!D3') form ?

  9. #9
    Registered User
    Join Date
    11-18-2008
    Location
    New Zealand
    Posts
    6
    shg:

    The penny dropped later in the day.

    One adds the 'left' bookend as the first sheets, create all the remaining sheets, then add the 'right' bookend.

+ 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