ERROR_VALUE

Description

Returns the substitute value if evaluating the value results in an error; otherwise, returns the original value.

Syntax

ERROR_VALUE(value, substitute_value) -> Object

Parameters

ParameterData TypeRequiredDescription
valueObjectYesThe value to evaluate.
substitute_valueObjectYesThe value to return if the evaluation of "value" results in an error.

Examples

ERROR_VALUE(1/0, 0)
-- Returns 0 because the division by zero results in an error.
ERROR_VALUE(CloseDate - TODAY(), 0)
-- Returns the days between CloseDate and today; returns 0 if the calculation errors (e.g., CloseDate is NULL).

Tips

  • Use ERROR_VALUE to prevent formula errors from invalid calculations or missing data.
  • Ensure value and substitute_value are of the same data type.

Related Formula