How to Sum Absolute Value in Excel: 6 Easy Ways

In this article, we will discuss 6 simple ways to sum absolute value in Excel. We will consider the below dataset that contains both negative and positive numbers.


1. Method 1 – Use ABS Function Inside the SUM Function to Sum Absolute Value

Steps:

  • Add a new row in the dataset to calculate the sum.

  • Write the following formula on cell B12.
=SUM(ABS(B5:B9)) 

ABS Function Inside the SUM Function to Sum Absolute Value

  • Press Enter to get the result.

The ABS function returns the absolute value of the selected range. The SUM function adds all the absolute values.


Method 2 – Get the Absolute Value of Sum Result Using SUM Inside ABS Function

Steps:

  • Go to cell B12 and put the following formula there.
=ABS(SUM(B5:B9))

SUM Function Inside the ABS Function to Sum Absolute Value

  • Press Enter to get the result.


Method 3 – Combination of Two SUMIF Functions to Sum Absolute Values

Steps:

  • Write the below formula at cell B12.
=SUMIF(B5:B9,">0")-SUMIF(B5:B9,"<0")

Two SUMIF Functions to Sum Absolute Values

  • Press Enter.


Method 4 – Combination of SUM and SUMIF Functions to Sum Absolute Value

Steps:

  • Write the following formula on cell B12.
=SUM(SUMIF(B5:B9,{">0","<0"})*{1,-1}) 

Combination of SUM and SUMIF Functions to Sum Absolute Value

  • Press Enter.

 


Method 5 – Get the Absolute Value of Sum for Specific Values Using SUMIF and ABS Functions

Steps:

  • We have 2 lists of numbers on the dataset.

We will apply a condition within the SUMIF function;  the sum of the positive numbers from list 1. From list 2, we will sum the negative numbers. We’ll add both results and apply ABS operation on the previous result.

  • Write the following formula to cell C11.
=ABS(SUMIF(B5:B9,">0")+SUMIF(C5:C9,"<0")) 

Combination of ABS and SUMIF Functions to Sum Absolute Value

Here, >0 is applied for positive numbers and <0 for negative numbers.

  • Press Enter.

 


Method 6 – Sum Absolute Value with a Function in Excel VBA

Steps:

  • Go to the bottom section of the worksheet.
  • Press the right button of the mouse.
  • Choose the View Code option from the Context Menu.

  • The VBA window appears.
  • Choose the Module option from the Insert tab.

  • Write the following VBA code on the VBA module, and save this code.
Function ABS_SUM(range_1 As Range) As Double
Dim sum_1 As Double
Dim cell_1 As Range
Result = 0
On Error GoTo Done
For Each cell_1 In range_1
sum_1 = sum_1 + Abs(cell_1)
Next cell_1
Done:
ABS_SUM = sum_1
End Function

VBA code to Sum Absolute Value

  • Go to cell B12.

The newly created function appears here.

  • After inserting the whole function choose the range from the dataset. So, the formula becomes:
=ABS_SUM(B5:B9)

Customized VBA function to Sum Absolute Value

  • Press Enter.


Similar Readings


Download Practice Workbook

Download this practice workbook to exercise while you are reading this article.


<< Go Back to Excel ABS Function | Excel Functions | Learn Excel

 

 

 

 

 

 

 

 

Get FREE Advanced Excel Exercises with Solutions!
Alok Paul
Alok Paul

Alok Paul has completed his B.Sc. in Electronics and Telecommunication Engineering from East West University. He has been working on the ExcelDemy project for more than 2 years. He has written 220+ articles and replied to numerous comments. He is experienced in Microsoft Office, especially in Excel. He also led some teams on Excel and VBA content development. He has a keen interest in Advanced Excel, Data analysis, Excel Pivot Table, Charts, and Dashboard. He loves to research... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo