+ Reply to Thread
Results 1 to 7 of 7

Turning off data tables via formula

  1. #1
    Registered User
    Join Date
    09-21-2019
    Location
    Oxford
    MS-Off Ver
    365
    Posts
    3

    Turning off data tables via formula

    All -

    I have a (necessarily) complex spreadsheet with some associated data tables for running senstivities. The need to run these sensitivities is only occasional. The spreadsheet is being used by a range of people in different organisations.

    'Automatic recalculation except datatables' works fine to keep calc times reasonable. However, the other users are reporting instability when they save. Obviously Excel recalcs the datatables on save, and I think if the user has other spreadsheets open, these may all get recalculated too. I'm not sure if this is actually causing instability, but I can certainly believe the long calc time is giving the perception of a freeze.

    There are various options I can think of, but they all have weaknesses:
    1. Teach the various users to hit 'escape' to stop the recalc-on-save (though my own experience is that this can genuinely lead to a crash)
    2. Switch to pure manual recalculation, with no recalc on save (though this is error prone for the user, and anyway just means that they have to take the 'full recalc' hit in the middle of their work, rather than on saving)
    3. Apply some VBA (though I'm not sure the various organisations where the users are will allow them to run VBA)

    So I was wondering whether there was a way to temporarily 'neutralise' the datatables via formula. My thought was to set up the datatable output cells along the lines of

    =IF(data_tables_live, interesting_result, NA())

    The idea was that if cell data_table_live was set to FALSE, then the cell feeding the datatable would not depend on the rest of the spreadsheet, and recalc would be fast. However, some experimentation suggests this doesn't work. Either Excel recalcs the entire spreadsheet by default for each cell in a datatable, or the dependency tree doesn't take advantage of the branching of the IF statement into a deadend in this case.

    Is there another way to have a 'switch' for the datatables within the spreadsheet that will isolate them from recalc in a similar manner? Or indeed some other better solution I haven't thought of?

    Thanks very much for your help

    Rob

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: Turning off data tables via formula

    Can you split the data and sensitivity tables into separate workbooks? Then you only open the sensitivity tables workbook if/when it is needed. That is, open the sensitivity tables workbook, it calculates, you do what you need to with the data, and you close it.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    09-21-2019
    Location
    Oxford
    MS-Off Ver
    365
    Posts
    3

    Re: Turning off data tables via formula

    Trevor -

    Thanks for coming back to me so quickly.

    IIRC, datatables can only drive cells within their own worksheet. So the datatables in sensitivy.xls would have to refer to assumptions within that file. Thus model.xls would need to be driven off those same assumptions in sensitivity.xls. Thus the user would need to have both files open (and linked for the purposes of calculation) even if they were just doing basic amendments to inputs and not interested in running the tables. By extension, when they closed the file(s) they'd have the same recalc issues.

    I think that puts me back where I started - but perhaps I'm missing something?

    Thanks again
    Rob

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: Turning off data tables via formula

    Hence the question ...
    Can you split the data and sensitivity tables into separate workbooks?
    I don't know what is feasible or practical in your environment, so it was a question/suggestion.

    I also don't know who uses the spreadsheets or what they do with them. You said that using the sensitivity tables was occasional. So, the idea was to separate the elements and, maybe, 90%-95% of the time you would not have that calculation/performance hit. And the users would need to be made aware that they should save and close other workbooks before working with the sensitivity tables workbook. If they've been told and they ignore the advice, that's down to them.

    Whatever, I don't know enough about your workbooks/worksheets/data to be able to offer a definitive solution.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: Turning off data tables via formula

    I know VBA may be a problem, but see this for an explanation and possible solution.

    https://fastexcel.wordpress.com/2015...tion-with-vba/

  6. #6
    Registered User
    Join Date
    09-21-2019
    Location
    Oxford
    MS-Off Ver
    365
    Posts
    3

    Re: Turning off data tables via formula

    Having spent some more time with your idea of splitting the workbooks, I think it is the basis of a solution.

    The assumptions and datatables can both sit in Sensitivity.xls. Model.xls can then link to those assumptions, but with a local copy also. I then build a data_tables_live switch into Model.xls. If 'No' then Model will work from its local copies of the assumptions. If 'Yes', then it will work off those drawn from Sensitivity.xls.

    Having checked this, if only Model.xls is open, in does simple recalcs only. (It may or may not be pulling the assumption figures from the closed Sensitivity.xls file, but even if it is, this isn't triggering a datatable recalc). Users can use Model.xls on a standalone basis, changing input assumptions if they wish, getting expected results.

    When it's time to run sensitivities, we open both files and set data_tables_live to 'Yes'. The datatables in Sensitivities.xls then do their thing, pulling results across from Models.xls as required.

    So thanks for getting me to the answer!

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: Turning off data tables via formula

    You're welcome.


    Sometimes it just helps to talk through ideas


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. turning formula into VBA code
    By steddas in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-24-2018, 01:30 PM
  2. Turning frequency tables into raw data
    By janef1160 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-22-2015, 01:46 PM
  3. Replies: 34
    Last Post: 01-21-2014, 03:07 PM
  4. Replies: 2
    Last Post: 10-27-2011, 12:25 PM
  5. Turning columns into tables
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-14-2010, 04:53 PM
  6. Turning of auto subtotal in Pivot Tables
    By jpx in forum Excel General
    Replies: 0
    Last Post: 01-28-2010, 05:14 PM
  7. Turning Text into a Formula
    By iainkane in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-06-2007, 06:18 PM

Tags for this Thread

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