Volatile Functions.

A Volatile Function is one that causes recalculation of the formula in the cell where it resides every time Excel recalculates. This occurs regardless of whether the precedent data and formulas on which the formula depends have changed, or whether the formula also contains non-volatile functions.

FastExcel measures Workbook Volatility by comparing the time for a Recalculation to the time for a full calculation, and allows you to measure worksheet volatility by comparing the sheet recalculate time with the sheet full calculate time.

Presumably this volatile behaviour was added to give correct results when B2:B4 were changed. Thanks to Luke Wisbey for letting me know about this behaviour.

Using a volatile function in a formula will flag the cell containing the formula as volatile, even if the volatile function never gets executed:

=IF(1<2,99,NOW()) will always return 99 and the volatile NOW() function will never be called, but the cell containing the IF formula will be treated as volatile, (thanks to Stephen Bullen for pointing this out). If cell A1 contains =NOW() then =IF(1<2,99,A1) will always return 99, but the cell containing the IF formula will NOT be treated as volatile.

=INDEX(A1:A5,3,1) is only indirectly dependent on volatile cell A1 and will NOT always be recalculated, but it will be recalculated once if for example cell A5 is changed even though the answer will not change.

IF(), CHOOSE(), AND(), OR()

The IF and CHOOSE functions only execute ONE of the available choices. This is called short-circuiting:

If you create UDFs One, Two and Three each of which contain a debug.print or MsgBox statement so that you can see what is being executed then:

=IF(True,One(),Two()) will only execute the One() udf, and not the Two() udf.

Women's Black Women's UGG Jerene UGG =CHOOSE(2,One(),Two(),Three()) will only execute the Two() udf and not the One() or Three() udfs.

=OR(One()=1,Two()=1,Three()=1) will always execute the Two() and Three() UDFs even though Women's UGG Jerene Black UGG Women's One()=1 will always be true.

Volatile only at Workbook Open

References to UDFs where the UDF itself is located in an XLA or external workbook are flagged as dirty when the workbook containing the reference is opened: if calculation is Automatic they will be recalculated at workbook open, if calculation is Manual they will be recalculated at the next recalculation.

Using INDEX as the second part of a range reference, for example A$2:INDEX(A$2:A$8,7,), will also cause the reference to be flagged as dirty when the workbook is opened. (Thanks to Bill Wood for spotting this).

Because a cell has been flagged as dirty the workbook will also be flagged as Unsaved so you may get an unexpected prompt to Save the workbook when closing it.

Conditional Formats are volatile.

Because conditional formats need to be evaluated at each calculation any formulae used in a conditional format is effectively volatile. Actually conditional formats seem to be super-volatile: they are evaluated each time the cell that contains them is repainted on the screen, even in Manual calculation mode, although VBA functions used in conditional formats will not trigger breakpoints when executed by the repaint.

Volatile Actions: Actions that trigger calculation

Autofilter

UGG Jerene Women's UGG Black Women's Selecting any filtering criteria when using Autofilter will flag ALL the formulae in the autofilter range as uncalculated, even if none of their precedents have changed and even if you select exactly the same filter criteria as before. This can cause Autofilter calculation to be extremely slow.

Clicking Row or Column Divider

If calculation is set to Automatic clicking or doubleclicking a row or column divider will trigger a recalculation. But manually changing the height or width of a column or row will NOT trigger a recalculation.

In Manual mode these actions do not flag the workbook as requiring calculation.

Inserting or Deleteing Rows, Columns or Cells, or Moving Cells

Insert or Delete Rows or Columns or Cells, or moving Cells (using Drag/Drop or Cut/Paste) anywhere on a Sheet, even to the right or below the Used Range. AND – The Worksheet contains cells which:

EITHER - Are Named OR - Contain Formulae with Names referring to this Worksheet or other Worksheets OR – Contain Formulae that Refer to other Worksheets OR – Contain Formulae that are referred to by other Worksheets

Then these cells become flagged as uncalculated.

Adding, Changing or Deleting Defined Names

Any action taken to add, delete, change or alter a defined name or its refersto property will trigger a recalculation.

Renaming Worksheets and Changing Worksheet Position

Changing the name of a worksheet or moving it will trigger a recalculation in Automatic mode.Jerene Black UGG UGG Women's Women's In Manual calculation mode, the statusbar will show "Calculate" ONLY if any formulae on any other sheet refer to the sheet with the changed name/position.

Deleteing Worksheets, but not Adding Worksheets

In Automatic mode deleting a worksheet will trigger a recalculation, but adding a worksheet will not.

Hiding or Unhiding Rows in Excel 2003

Black Jerene Women's UGG Women's UGG In Excel 2003 hiding or unhiding rows will flag the selected rows as uncalculated, even if no rows were actually hidden or unhidden. If calculation is automatic this will trigger a recalculation. This behaviour is a change from previous versions. Hiding or unhiding columns does NOT flag the column as uncalculated.

Probably the reason for the change is that the SUBTOTAL function in Excel 2003 has an option to include or ignore hidden rows, so Excel needs to be able to trigger a dependency recalculation by dirtying the cells when a row is hidden or unhidden.

Opening a .CSV file

Whenever you open a .CSV file, either through VBA or File-->Open, a recalculation of all open workbooks will be triggered, even if calculation is in Manual. Switching off .EnableEvents does not stop this recalculation. The only way I have found to prevent this recalculation from happening is to use VBA to switch Worksheet.EnableCalculation to False for each worksheet that you do NOT want to be calculated.