ABS Function (LibreOffice Calc)
The ABS function in LibreOffice Calc returns the absolute value of a number. It removes the sign and always returns a non‑negative result. Learn syntax, examples, common errors, and best practices.
Tested: Examples checked in LibreOffice Calc 25.2.3.2. What this means
This guide provides syntax, examples, advanced usage patterns, common errors, and best practices, making it one of the most complete ABS references available for LibreOffice Calc.
Native-tested visual example: Remove the sign from a numeric difference
A stock-count variance is -18.75. ABS reports its magnitude without the negative sign.
Enter this formula in cell E5:
=ABS(B5)
Expected result: 18.75. ABS(-18.75) returns 18.75. It does not round or modify the stored source value.

Real screenshot captured from LibreOffice Calc 25.2.3.2. The selected E5 cell shows the calculated result and the formula bar displays the entered formula.
Download the editable ABS example (.ods) — change the sample input cells and watch the calculation update.
Why it works: ABS(-18.75) returns 18.75. It does not round or modify the stored source value. Watch for: If you need to preserve whether a result is positive or negative, keep the original number in another cell.
Verification: Example calculated in LibreOffice Calc 25.2.3.2. Screenshot is a genuine application capture, not a mockup.
What the ABS Function Does
- Returns the absolute value of a number
- Converts negative numbers to positive
- Leaves positive numbers unchanged
- Works with cell references, formulas, and expressions
- Useful for error handling, distance calculations, and normalization
- Works seamlessly with other math and statistical functions
It is designed to be fast, reliable, and universally compatible.
Syntax
ABS(number)
Arguments
- number:
Any numeric value, cell reference, or expression.
Examples:-10A1A1 - B1SUM(A1:A5)
Basic Examples
Convert a negative number to positive
=ABS(-10)
Returns 10.
Leave a positive number unchanged
=ABS(25)
Returns 25.
Use ABS with a cell reference
=ABS(A1)
Returns the absolute value of whatever is in A1.
Use ABS with a formula
=ABS(A1 - B1)
Returns the absolute difference between A1 and B1.
Advanced Examples
Calculate absolute percentage difference
=ABS((A1 - B1) / B1)
Useful for comparing actual vs expected values.
Use ABS to measure deviation from a target
=ABS(A1 - 100)
Returns how far A1 is from the target value of 100.
ABS with SUM
=ABS(SUM(A1:A10))
Ensures the total is always non‑negative.
ABS with IF for conditional logic
=IF(ABS(A1) > 50; "Large"; "Small")
Classifies values based on magnitude.
ABS with ROUND
=ROUND(ABS(A1 - B1); 2)
Returns the rounded absolute difference.
ABS with SIGN to normalize values
=ABS(A1) * SIGN(B1)
Applies the sign of B1 to the magnitude of A1.
Common Errors and Fixes
ABS returns 0 unexpectedly
Possible causes:
- The input expression evaluates to 0
- A number is stored as text
- A referenced cell is empty
Fix:
Convert text to numbers using:
Data → Text to Columns → OK
ABS returns a number formatted incorrectly
Often caused by:
- Cell formatting set to text
- Custom formatting hiding negative signs
Fix:
Format → Cells → Number → General
Err:502 — Invalid argument
Occurs when:
- The argument is non‑numeric text
- A formula returns an error passed into ABS
Fix:
Wrap the expression with IFERROR:
IFERROR(ABS(A1); 0)
Best Practices
- Use ABS when only magnitude matters, not direction
- Combine ABS with IF for threshold‑based logic
- Use ABS in financial models to avoid negative totals
- Use ABS to compare values without worrying about sign
- Normalize data by pairing ABS with SIGN
Related Patterns and Alternatives
- Use SIGN to determine the sign of a number
- Use ROUND, INT, or TRUNC to control numeric precision
- Use POWER(number; 2) and SQRT to compute Euclidean distances
- Use MAX(A1; -A1) as a manual alternative to ABS
By mastering ABS and its combinations with other math functions, you can build precise, reliable numeric models in LibreOffice Calc that handle magnitude cleanly and consistently.
Reproducible example (tested in LibreOffice Calc)
This standalone example was calculated in LibreOffice Calc 25.2.3.2 and matched the expected value. It is a practical cross-check of one usage, not proof that every example elsewhere on this page is correct.
=ABS(-9)
Expected result: 9.
Calculate how far a change is from zero without keeping its sign.
If the result differs, check the referenced cells, argument separators and number formatting. For more information, consult the LibreOffice Calc official help.