Reputation: 229
Say I have a relatively computationally expensive and long function f(.) dragged down a column. If the result of the function in any given cell is an arbitrary value x, then I want the value of the cell to be the arbitrary value y. Of course, this can be accomplished quite easily like this
=IF(f(.) = x, y, f(.))
I have two questions:
Thank you.
Upvotes: 1
Views: 750
Reputation: 96753
Here is an example. Say the function is:
A1+A3+A5+A7+A11+A13
and our IF()
is:
=IF(A1+A3+A5+A7+A11+A13=99,"top",A1+A3+A5+A7+A11+A13)
To avoid repetition:
=LET(f,A1+A3+A5+A7+A11+A13,IF(f=99,"top",f))
Upvotes: 1
Reputation: 3034
I guess we may use substitute like
=SUBSTITUTE(f(.),x,y)*1
Then it should not calculate the inner function twice.
Upvotes: 1