Summing two ranges but only including the positive numbers

capstonemech

New Member
Joined
Sep 27, 2010
Messages
3
I have two ranges of numbers that I want to get certain numbers from. When they are summed, some come out as positive numbers, and some negative. I want to collect and sum all the positives together, and all of the negatives together. I know I can do this in multiple steps, but I want to see if I can use some type of SUMIFS or ARRAY to contain this calculation in to one cell gathering the summed positive numbers and one cell gathering the summed negative numbers. See picture for example.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
That works great if I want to just SUM positive numbers in one range. My issue is that I want to SUM the numbers provided by adding/subtracting TWO ranges together and then using the numbers based off of the calculation.

Example:
Cell A1 100
Cell B1 50
If I SUM them, I get 150, a positive number.
Cell A2 100
Cell B2 150
If I SUM them, i get -50

it isn't the range of numbers I want to gather and sum, it is the post calculation number that I want to only SUM if it is either a positive number, or a negative number
 
Upvote 0
That works great if I want to just SUM positive numbers in one range. My issue is that I want to SUM the numbers provided by adding/subtracting TWO ranges together and then using the numbers based off of the calculation.

Example:
Cell A1 100
Cell B1 50
If I SUM them, I get 150, a positive number.
Cell A2 100
Cell B2 150
If I SUM them, i get -50

it isn't the range of numbers I want to gather and sum, it is the post calculation number that I want to only SUM if it is either a positive number, or a negative number

Not clear... How or why do you get -50 when you SUM A2 and B2?
 
Upvote 0
Assuming the answer to Aladin's post is that you are actually wanting to Subtract Column A from Column B and only sum when the resulting value is positive:

in a separate cell:

{=SUM(IF($A$2:$A$10-$B$2:$B$10>0,$A$2:$A$10-$B$2:$B$10))}

confirm with contrl+shift+enter to put the {} as this is an array.

I am betting though that this is a better solution.
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,924
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top