![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Location: Queens, New York
Posts: 3
|
I'm working on a spreadsheet in which one column has both negative and positive number. Below the column I would like a sum of the absolute values of those figures I tried this formula but it didn't work. =sum(abs(A1:a5)) I also tried =sum(abs(a1):abs(a5)). Any ideas.. Please help.
-Danny |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
=SUMPRODUCT((ABS(A1:A5))) would do. |
|
|
|
|
|
#3 |
|
New Member
Join Date: May 2002
Location: Queens, New York
Posts: 3
|
Thanks Aladdin. It works perfectly.
-Danny |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Denver, CO
Posts: 1,744
|
I'm glad you got a workable solution. Another way to do this without an array type solution would be
=SUMIF(A1:A5,">0")-SUMIF(A1:A5,"<0") I'd only go with this if you are using the formula often in a big sheet and notice performance issues. Good luck |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|