Math
Taking the gap between two numbers
Definition
Taking the absolute difference of two numbers means wrapping their subtract in ABS.
Syntax
=ABS(number)
Arguments
| Argument | Meaning |
|---|---|
number |
The difference to make positive, for example B2-C2. |
Worked example
A stock sheet stores the plan in B2 and the count in C2. The count is lower, so the raw subtract is negative.
| A: Bin | B: Plan | C: Count |
|---|---|---|
| A | 20 | 12 |
| B | 9 | 9 |
| C | 6 | 11 |
Formula: =ABS(B2-C2)
Result: 8. 20 minus 12 is -8, and ABS turns that gap into 8.
Practice
Cell A2 holds 3. Cell B2 holds 10. In C2, write a formula that returns the absolute difference between A2 and B2.
- In C2, write an ABS formula for A2 minus B2.
- C2 should show the absolute value of A2 minus B2.
Step 1 of 2
Enter =ABS(A2-B2) in C2.
A2 is 3 and B2 is 10, so the absolute value of 3 minus 10 is 7.
Formulas here use English function names, such as SUM, and a period as the decimal separator, in every language.
Loading the sheet…
C2 uses ABS.
C2 now shows 7.
The next lesson is Finding the remainder of a divide.
Related functions
ABS is the function that turns that difference into a positive gap.
Common mistake
Leaving ABS out, as in =B2-C2: the result is -8 instead of the gap 8.