I'm running the same MATCH
function in my spreadsheet numerous (say 100) times.
Is it better/worse/no difference to code the function 100 times, into each cell where it's used, rather than do it once in some other cell and then refer to the value of that cell 100 times?
I'm interested mainly in the effect on code efficiency (but I think it also impacts code readability).
From what I understand, it might make no difference given the way Excel does or does not recalculate everything when the data changes (MATCH
is non-volatile, I believe?).
Full context:
Columns J
onward contains monthly data (J
has July 2015
, K
has Aug 2015
, etc).
Elsewhere in the spreadsheet, I want to produce various summary information (e.g. total widgets built last quarter), but I want the user to be able to specify the month they're interested in (e.g. if the user enters June 2015
into a cell, the last quarter is Jan-Mar, if they enter July 2015
it's Apr to Jun).
So in my summary info, I need to:
- Look up the column corresponding to the month the user has entered.
- Do various calculations based on the information in the previous few columns.