In the cells that call the custom function, create a built-in function that does not change the value that is returned by the custom function. For example, create a built-in function that is similar to the following:
Original formula=CUSTOMFUNCTION(A1:A50)
Updated formula=IF(COUNT(A1:A50)<0,NA(),CUSTOMFUNCTION(A1:A50))
Note In this function, the
COUNT(A1:A150) function is not evaluated until all the precedent cells in the array are calculated. The custom function is called only after all the precedent cells in the array range of the
COUNT(A1:A50) function are calculated. The COUNT will always be 0 or greater. Therefore, the IF condition will always result in a FALSE value. When you receive a FALSE value, your custom function will be called.