I was creating a spreadsheet the other day and I stumbled across the following "problem".
I wanted to test the result of a function against a value and if that was true, display the result of the function, otherwise display a default value.
What I started doing is:
=if(function()="X",function(),"default value")
( function() being a generic name for any function)
But I thought, this way I'm adding extra load to my sheet by running this function twice. I tried looking online for a way to do the same thing by running the function only once but I couldn't find anything (or more like couldn't find the right keywords to do so).
Is there anyway to get around this?