If function returns number, use the number, else 0

I find the canonical way of doing this repeats the function and can be VERY long-winded if the function has a load of arguments looking like:

=IF(ISNUMBER(F(x)); F(x); 0)

Is there some way of writing this generically with only one reference to F(x)? Akin to:

= VALUE(F(x), 0)

This would make for much more elegant formulae.

Can you make it so that all unacceptable values “degenerate” the formula result to an error condition?

If so, the IFERROR() function may be what you need.

=IFERROR(F(x);0)

Or even better, injecting a NA() somewhere that can be caught with IFNA() so not all errors are suppressed.

Thanks kindly! Works a charm! Indeed, trapping errors suffices for me.