sum at the end of positive and negative number

Excel777

Well-known Member
Joined
Jul 3, 2009
Messages
912
Office Version
  1. 2019
hi all
i have column a have positive and negative numbers i want to add sum in column b at each sequence of positive and negative number for example first positive sequence start from 1 to 2 so sum equal 3 second negative number start at 3- to -5 so results equal -11

i want formula to add in column b to solve this problem

1
2 Result 3
-3
-3
-5 Result -11
6
2
4
4 Result 16
-1
-5
-6 Result -12
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Try this in B2 and fill down

=if(SIGN(A2)=SIGN(A3),"",SUM(A$1:A1)-SUM(B$1:B1))
 
Upvote 0
it's not working it give me these results
Results
1
21
-3
-3
-5-4
6
2
4
47
-1
-5
-6-2
 
Upvote 0
When you post examples that people can not copy and paste into excel to test formulas, that the formulas are not usually tested and incorrect results are inevitable.

=if(SIGN(A2)=SIGN(A3),"",SUM(A$2:A2)-SUM(B$1:B1))

It is preferable to minimise potential errors and confusion by posting examples with XL2BB rather than using screen captures, direct copy and paste or typed examples with no formatting.
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,140
Members
448,551
Latest member
Sienna de Souza

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