=OFFSET(INDIRECT(ADDRESS(ROW(), COLUMN())),-4,2+MATCH(MIN(OFFSET(INDIRECT(ADDRESS(ROW(), COLUMN())),0,3,1,10)), OFFSET(INDIRECT(ADDRESS(ROW(), COLUMN())),0,3,1,10), 0),1,1)
in the above example (don’t consider what it does), I have to evaluate twice the exact same expression : OFFSET(INDIRECT(ADDRESS(ROW(), COLUMN())),0,3,1,10)
Is there a way to add variables on the fly in formulas? So that we store once the result and simply refer to it later on within the formula ? This is an example in which the cost of computing several times the same thing has no impact, but what about more costly calls or computations ?
I’m thinking of some feature that are existing in recursive functional languages such as Caml.
You could replace Indirect(address(row(),Column()) with a simple relative cell reference, but to answer your question:
yes it is possible using Laurent Longre’s MOREFUNC addin – it has functions SETV and GETV that do exactly what you want.