Forum Discussion
BillF44
Jul 10, 2022Copper Contributor
Summing positive/negative amounts across sheets
Message Edited. Sorry for my mistakes in the original. ---------------------------------------------------------------- Sum Profit and/or Loss from a column from 1 sheet (Raw) in 2nd sheet (Stats)...
SergeiBaklan
Jul 10, 2022Diamond Contributor
It depends on which Excel version / platform you are. As variant
=SUMPRODUCT( data * ( SIGN(data) > 0) )
=SUMPRODUCT( data * ( SIGN(data) < 0) )
=SUM( INDEX( data, AGGREGATE(14, 6, 1/(data>0)*ROW(data), {1,2,3} ) ) )
=SUM( INDEX( data, AGGREGATE(14, 6, 1/(data<0)*ROW(data), {1,2,3} ) ) )
assuming data is from first row, otherwise to adjust a bit.