Excel.Tips.Net ExcelTips (Menu Interface)

Summing Absolute Values

Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Summing Absolute Values.

Joseph has a worksheet that contains a list of values. Some of those values are above zero and others are below. He can use the SUM function to calculate a sum of the values, but he really wants to calculate a sum of the absolute value of each item in the list. So, the sum of the three values -33, 14, -5 would be 52 instead of -24.

There is no intrinsic function you can use to create the desired sum, but you can create a formula to perform the task. One method is to use the SUMIF function, in the following manner:


The first SUMIF sums all the values that are greater than zero, and the second sums all those less than zero. Thus, with the four values -33, 14, -5, 42, the first SUMIF would result in a sum of 56 (14 + 42) and the second would result in a sum of -38 (-33 + -5). When you subtract the second sum from the first (56 - -38) you get a final answer of 94, which is the sum of all the absolute values.

Another approach is to use the SUMPRODUCT function. The following formula will produce the desired result:


The function is typically used to multiply different elements of arrays by each other, and then sum those products. Since only one array (A1:A10) is provided, there is no multiplication done, but a sum of the desired absolute values is returned.

You can also get the desired result by using an array formula, a convenient but seldom used feature of Excel. Assuming your values are in the range A1:A10, type this formula:


Don't press Enter; instead press Ctrl+Shift+Enter, which signifies this is an array formula. If the formula is entered correctly, you'll see braces around the formula in the Formula bar:


What the formula does is internally create the intermediate column (which is an array of values) which are the individual absolute values of A1:A10. It then sums this array and displays the result.

Finally, if you prefer you could create your own user-defined function (a macro) that will return the sum of the absolute values in a range. The following is a macro that will accomplish this task:

Function SumAbs(Rng As Range) As Double
    Result = 0
    On Error GoTo Done
    For Each element In Rng
        Result = Result + Abs(element)
    Next element
    SumAbs = Result
End Function

You can use the function by entering a simple formula in your worksheet:


ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2913) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Summing Absolute Values.

Related Tips:

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!


Leave your own comment:

  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*What is 4+5 (To prevent automated submissions and spam.)
          Commenting Terms

Comments for this tip:

Michael (Micky) Avidan    14 Aug 2015, 05:48
@Sabdjong Tomi,
Please present your data table OR much better would be to upload your Workbook to a File Hosting site and let us have the link to download it.
*** Please explain - exactly - what your are trying to calculate
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2016)
Sabdjong Tomi    14 Aug 2015, 04:24
Dear Allen

is this forula correct to compte the average of absolute value in a range of data?

John    29 Jul 2015, 16:36
That was awesome, thank you!
Robert    09 Feb 2015, 10:07
@ Micky -

Forgive the double email - my coworker was able to get it to work.

Thank you!

Robert    09 Feb 2015, 10:05
@ Micky

Thank you for the prompt reply.

I tried to use your formula and I was not able to get it to work.

I tried:


and got an "#VALUE!" error.
Michael (Micky) Avidan    09 Feb 2015, 06:00
If I understood you correctly and assuming you have:
A1:A10 with TickMarks
B1:B10 With Pos. & Neg. values ) in order to sum the absolute values that have a "W" in the adjacent cell - try the following formulas:
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2015)
Robert     09 Feb 2015, 00:51
Is there a way to incorporate the =SUMIF(A1:A10,">0")-SUMIF(A1:A10,"<0") with an additional SUM IF?

Specifically, I have a table of data with both positive and negative values. I'd like to perform a SUM IF, in absolute value, on a portion of the tables' data, indicated by a single column Tickmark?

For example, I'd like to SUM IF "W" in a column)

So I'm thinking of somehow creating a SUM IF = (indicate the "W", add your SUM IF to get absolute value)?
Thomas    11 Sep 2014, 16:18
This was the tip I needed. I was dealing with a negative number in format (35), and the formula handled the number format just fine. Thanks

Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us


Advertise with Us

Our Privacy Policy

Our Sites


Beauty and Style




DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2016)



Home Improvement

Money and Finances


Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2016)

Our Products

Helpful E-books

Newsletter Archives


Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2015 Sharon Parq Associates, Inc.