← All how-to recipes

How to get the absolute value (and sum absolute values)

✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)

Strip the sign from numbers — distances, error magnitudes, reconciling debits and credits.

The formula

AppFormulaNotes
Excel (desktop)=ABS(A2)Sum a whole range's magnitudes in one cell: =SUMPRODUCT(ABS(A2:A10)).
Google Sheets=ABS(A2)Identical, including the SUMPRODUCT pattern.
LibreOffice Calc=ABS(A2)Identical.

How it works

ABS drops the sign: −37.5 becomes 37.5, and positives pass through unchanged. The common follow-on is totaling magnitudes regardless of direction — =SUMPRODUCT(ABS(A2:A10)) does it without a helper column (SUM(ABS(range)) alone won't work in older Excel without Ctrl+Shift+Enter). Also handy in comparisons: ABS(A2-B2)<=0.01 tests whether two numbers are within a tolerance, the robust way to compare floats.

Verified, not just documented

We ran =ABS(A2) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 37.5 — exactly the expected result. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned 37.5 for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.

Functions used

ABS — see full Excel, Google Sheets & LibreOffice compatibility for each.

Related recipes