DIVIDE

The DIVIDE function performs a division by returning Blank or an alternative result if the denominator is zero.

Syntax

DIVIDE(
    numerator,
    denominator
    [, alternate_result]
)

Parameters
  • numerator: Dividend or numerator of the division.
  • denominator: Divisor or denominator of the division.
  • alternate_result: Optional argument. Value to return in the event that denominator takes the value zero.
Returned value

The DIVIDE function returns a real number.

Additional Information

If the alternate_result argument is not included, the function will return Blank in the event of a division by zero. alternate_result must be a constant numeric value (if you try to return a text string or a Boolean, the function returns an error).

Examples

In the following example, several pairs of numbers are divided, indicating the value zero as an alternative result:

DIVIDE function. Example of use

In this second example, the same pairs of numbers are divided without indicating an alternative result. The DIVIDE function, in these circumstances, returns Blank when it finds a division by zero:

DIVIDE function. Example of use

Category
Mathematical and trigonometric
Submitted by admin on Tue, 12/04/2018 - 11:36