-
We have functions in this structure that act volatile even though they are set to not be volatile (e.g. recalculates if a row is added). Does anyone have any idea what are doing wrong? [ExcelFunction(Description = "Grabs available curves. Please specify the quarter in this format: 2020Q4.", IsVolatile = false)]
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You are not doing anything wrong - you are seeing normal behaviour for any function in Excel, unrelated to the 'Volatile' concept. Compare the behaviour of a VBA function like this: Function Increment()
Static i As Integer
i = i + 1
Increment = i
End Function With a volatile function like You'll see that only the volatile function |
Beta Was this translation helpful? Give feedback.
You are not doing anything wrong - you are seeing normal behaviour for any function in Excel, unrelated to the 'Volatile' concept.
Excel recalculates the sheet when making structural changes like adding or deleting a row or column.
Compare the behaviour of a VBA function like this:
With a volatile function like
=RAND()
, putting both into a sheet.You'll see that only the volatile function
=RAND()
calculates when you edit some unrelated cell on the sheet, but both calculate if you add a row.