 | In Excel 2007, the ABS function returns the absolute value of a number — that is, the number's absolute distance from zero. You might remember from algebra class that the absolute value of a positive number is the number itself, and the absolute value of a negative number is the number but with the sign changed to positive. For example, =ABS(100) returns 100, as does =ABS(-100). |
The ABS function is handy in a number of situations. For example, sometimes imported data comes in as negative values, which need to be converted to their positive equivalents. Or, for example, when working with cash flows, the ABS function can be used to present cash flows as positive numbers.
A common use of the ABS function in Excel is to calculate the difference between two numbers when you don't know which number is the greater value to begin with. Say you need to calculate the difference between scores for two contestants. Score 1 is in cell A5, and score 2 is in cell B5; the result goes in cell C5. The formula in cell C5 would then be =A5-B5.
Plugging in some numbers, assume that score 1 is 90 and score 2 is 75. The difference is 15. Okay, that's a good answer. But what happens when score 1 is 75 and score 2 is 90? The answer is –15. This answer is mathematically correct but not presented in a useful way. The difference is still 15, not –15. By using the ABS function, the result is always returned as positive. Therefore, for this example, the best formula coding looks like this: =ABS(A5-B5).
Now regardless of who has the higher score, the correct difference is returned.
Here's how to use the ABS function:
1. Position the cursor in the cell where you want the results to appear.
2. Enter =ABS( to begin the function entry.
3. Click a cell where you entered a number, or just enter a number.
4. Type ) and press Enter.
|