@
Colin. ...may end up using inferior, non-volatile formulae instead. Which non-volatile formula do you class as 'inferior'?
Hi Jeff,
But that's my point: it entirely depends on the workbook setup and how it is used, so I can't make a generalisation. A non-volatile formula might be better in one case, but the same one may be worse in another case.
Since Charles' name keeps popping up on this thread, I'll give an example of one of his workbooks which I remember him telling me about. I'll add a disclaimer that this is the conversation as I remember it, it was way back in ~ 2009, it had been preceded by a few beers and I was jet-lagged!
He'd developed a workbook which made extensive use of OFFSET() formulae. The formulae and the whole workbook were lightning fast so the fact that they were volatile didn't matter a jot for that workbook's purpose.
This workbook had started life as a slow calculating workbook with extensive use of INDEX(). He 'fixed' it by, amongst other things, changing INDEX() formulae to OFFSET().
If I recall correctly one of the issues was the INDEX() formulae in that particular case, in conjunction with the other inner workings of that workbook, were creating a very bloated dependency tree. Perhaps they were similar to the =INDEX(Sheet1!1:1048576,3,1)[/code] mentioned earlier in this thread in that they had large precedent ranges?
So am I saying OFFSET() is better than INDEX()? Not at all. I'm saying it was better in that particular case. I think it's fine to lean towards INDEX() as a preference because it is not volatile (which I do), but I also think it is a mistake to completely dismiss OFFSET() as an alternative.
I read through the threads written by Charles which you referenced and I found this interesting quote from him:
•Avoid volatile functions like INDIRECT and OFFSET where you can, unless they are significantly more efficient than the alternatives. (Well-designed use of OFFSET is often fast.)
It sounds like the example I remembered is an example of this. Workbooks and calculations are complex things.