ABS
Returns the absolute value of a number.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=ABS(number)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
number | number | Required | — |
Remarks
- Negative numbers are returned as positive values.
- Zero and positive numbers are unchanged.
- Errors are propagated.
Examples
Evaluate a negative number with a fractional part.
Formula =ABS(-4.7)
Expected result 4.7
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Compare the result on the positive side of zero.
Formula =ABS(4.7)
Expected result 4.7
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Evaluate the function at the zero boundary.
Formula =ABS(0)
Expected result 0
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
A nonnumeric text value cannot be used as the number.
Formula =ABS("invalid")
Expected result #VALUE!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Absolute value of a negative number
Formula =ABS(-12.5)
Expected result 12.5
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Absolute value from a cell reference
Formula =ABS(A1)
| A | |
|---|---|
| 1 | -42 |
Expected result 42
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
How does ABS handle errors or non-numeric text?
Input errors propagate, and non-coercible text returns a coercion error.