+ Reply to Thread
Results 1 to 6 of 6

Inconsistent Calculation Results

Hybrid View

thomasutley Inconsistent Calculation... 04-23-2012, 06:31 PM
Richard Buttrey Re: Inconsistent Calculation... 04-23-2012, 06:44 PM
thomasutley Re: Inconsistent Calculation... 04-25-2012, 11:15 PM
Cutter Re: Inconsistent Calculation... 04-23-2012, 06:47 PM
thomasutley Re: Inconsistent Calculation... 04-26-2012, 12:11 AM
thomasutley Re: Inconsistent Calculation... 04-26-2012, 12:14 AM
  1. #1
    Registered User
    Join Date
    09-27-2011
    Location
    Tucson, Arizona
    MS-Off Ver
    Excel 2007
    Posts
    10

    Inconsistent Calculation Results

    All,

    I have a large workbook (45Mb) containing a tab at the back where a lot of calculations take information captured on other tabs and parses it across several tens of thousands of rows in a pre-formatted template for upload into a database application for use by others. The upload tab is large enough that autocalc was slowing down response time significantly (~10 sec to recalc the workbook). I added a VBA macro to the workbook that allows the user to temporarily disable autocalc on this last tab long enough to enter any required data in the other tabs. The user then re-enables autocalc on the last tab prior to uploading the results to the db system.

    After an initial trial deployment that involved loading all the other 70+ tabs with simulated trial run data, I received feedback that the upload sheet was not generating the correct results. Digging into it, I found that some rows were calculating correctly while other rows were not. On any cell that is not calculating correctly, if I highlight the cell, click in the formula bar at the top, and hit Enter, it will then return the expected result.

    Any thoughts on what might be causing this behavior?

    VBA macro I'm using to disable/reenable calculation on the upload sheet:

    Sub DisableACESCalculations()
    Me.Worksheets("ACES UPLOAD").EnableCalculation = False
    End Sub

    Sub EnableACESCalculations()
    Me.Worksheets("ACES UPLOAD").EnableCalculation = True
    Application.Calculate
    End Sub
    Thanks,

    Tom

  2. #2
    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: Inconsistent Calculation Results

    Hi,

    Are any of the cells non volatile (e.g. INDEX(), ROWS(), COLUMNS() ) - even if they don't have any precedents?
    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.

  3. #3
    Registered User
    Join Date
    09-27-2011
    Location
    Tucson, Arizona
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Inconsistent Calculation Results

    Richard, yes, there are several INDEX() functions involved. What should I know about these types of functions and how can I force them to update consistently?

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

    Re: Inconsistent Calculation Results

    Are there UDF's involved by any chance? If so: http://www.ozgrid.com/forum/showthread.php?t=34438

  5. #5
    Registered User
    Join Date
    09-27-2011
    Location
    Tucson, Arizona
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Inconsistent Calculation Results

    Had to get to my work PC to grab an example of one of the formulas that are giving me grief:

    =IF(AND(INDIRECT("'" & "." & AJ2 & "'!$F$1")=ALLOCATIONS!$B$17,INDIRECT("'" & "." & AJ2 & "'!$F$2")=(X2&Y2)),INDIRECT("'" & "." & AJ2 & "'!" & AN2),(INDEX(ALLOCATIONS!$E$18:$BB$23,MATCH(INDIRECT("'" & "." & AJ2 & "'!$F$1"),ALLOCATIONS!$B$18:$B$23,0),MATCH((X2&Y2),ALLOCATIONS!$E$12:$BB$12,0)))*INDIRECT("'" & "." & AJ2 & "'!" & AN2))
    BTW, most of the index and indirect entries were set up to facilitate dragging formulas to copy down several tens of thousands of rows rather than building sets for each of the input tabs. I'd rather someone put a bullet in my brain than consider rebuilding them all again without the lookups. Heh.

    Thanks,

    Tom

  6. #6
    Registered User
    Join Date
    09-27-2011
    Location
    Tucson, Arizona
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Inconsistent Calculation Results

    Update. Appears that using various combinations of Ctrl, Shift, Alt, and F9 will, in fact, force the cells to update. Not quite sure yet which combination is doing what but I think I'm onto something, perhaps the workbook doesn't know the upload cells are dirty and need recalculating even with a manual F9 calculate command.

+ 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