ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sum of values in column A based on 0/1 of column B (https://www.excelbanter.com/excel-worksheet-functions/447211-sum-values-column-based-0-1-column-b.html)

Wael2029

Sum of values in column A based on 0/1 of column B
 
Dear all,

I have 3 columns column A "gain" which is the amount of money (e.g., 230), column B is "condition" it is either 0 = success or 1 = failure and column C is "total sum".
With each new row the total sum will calculate the gain with that formula =SUM($A$2:A2).

All I need is to start again when column C = 1. So, how to make formula in column C check the 0/1 in column B and start the summation from the next value in column A

Claus Busch

Sum of values in column A based on 0/1 of column B
 
Hi,

Am Mon, 24 Sep 2012 17:24:10 +0000 schrieb Wael2029:

I have 3 columns column A "gain" which is the amount of money (e.g.,
230), column B is "condition" it is either 0 = success or 1 = failure
and column C is "total sum".
With each new row the total sum will calculate the gain with that
formula =SUM($A$2:A2).

All I need is to start again when column C = 1. So, how to make formula
in column C check the 0/1 in column B and start the summation from the
next value in column A


in C2:
=A2
in C3:
=(B3=0)*C2+A3 and drag down


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

Wael2029

Claus Busch

many thanks .. it was a smart one .. best regards


All times are GMT +1. The time now is 04:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com