Forum Discussion
Which formula to create?
In order to generate meaningful references I placed both the Master data and the Options in appropriately named Tables. Given that there exist two choices for the lookup data I first provided the formula
= IF( [@[A or B]]="A", Choice[A], Choice[B] )
to select the relevant column. Then, since the look up data is sorted in age order I used the LOOKUP function to return the cost from the corresponding cell of that column. Nesting the formulae one obtains
= LOOKUP([@Age], Choice[Age], IF( [@[A or B]]="A", Choice[A], Choice[B] ) )
A variant is to use a defined Name 'AgeRelatedCost' to refer to the first formula, in which case the second reduces to
= LOOKUP( [@Age], Choice[Age], AgeRelatedCost )
Overall, the objective is not to create short formulas; it is to create clear formulas that are easy to read.