Going Stellar

Home/Google Sheets reference

Google Sheets function · Math

ABS in Google Sheets: syntax and examples

ABS returns a number without its sign: -12.5 becomes 12.5 and positive numbers stay the same. It is the usual way to measure a gap or error when the direction does not matter.

Syntax

ABS(value)

Arguments

ArgumentTypeRequiredWhat it does
valuenumberyesThe number whose sign is removed. Text that looks like a number is converted first.

Examples

The examples use this table, starting in A1:

ItemPlanActual
A10087.5
B250310
C8080
=ABS(C2 - B2)

Result: 12.5

The gap between plan and actual, without caring which side it falls on.

Run in a Google Sheet (English US locale) on .

=ABS(C3 - B3)

Result: 60

Actual above plan: the difference is -60 and ABS makes it 60.

Run in a Google Sheet (English US locale) on .

=SUM(ARRAYFORMULA(ABS(C2:C4 - B2:B4)))

Result: 72.5

Total absolute gap across all rows. ARRAYFORMULA makes ABS work on the whole range.

Run in a Google Sheet (English US locale) on .

=ROUND(ABS(-7.25), 1)

Result: 7.3

The sign is dropped, then ROUND keeps one decimal.

Run in a Google Sheet (English US locale) on .

=ABS("-5")

Result: 5

Text that holds a number is accepted and converted.

Run in a Google Sheet (English US locale) on .

Common errors

  • ABS takes one value. On a range it needs ARRAYFORMULA: SUM(ABS(C2:C4-B2:B4)) returns #VALUE!, while SUMPRODUCT(ABS(C2:C4-B2:B4)) works without it.
  • Text that is not a number, such as "abc", returns #VALUE!. A blank cell is read as 0.

Compared with Excel

Same syntax in Excel.

Sources

  1. ABS (Docs Editors Help)

Markdown version · All functions