=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.
The Excel LET function allows you to assign names to calculation results and define variables inside a formula, so that the formula looks clearer and works faster. Essentially, the concept is the same as naming cells, ranges and formulas in the Name Manager.
Variable cells (Changing cells or Adjustable cells in earlier versions) are cells that contain variable data that can be changed to achieve the objective. Excel Solver allows specifying up to 200 variable cells.
Here, R refers to the Row and C refers to the column, so R1C1 would refer to the cell in the first row and first column. Similarly, R2C3 would refer to the cell in the second row and third column.
If your question relates to the convenience of writing formulas, the Name Manager is what you're looking for. See in the ribbon menu in the tab "formulas". Click on "new"
Name: MyArray
Scope: Workbook
Refers to: =OFFSET(INDIRECT(ADDRESS(ROW(), COLUMN())),0,3,1,10)
If your question relates to computation cost, I believe your only solution is to physically store the intermediate results in an additional column or separate worksheet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With