ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Conditional Formula Question (https://www.excelbanter.com/excel-worksheet-functions/134398-conditional-formula-question.html)

iperlovsky

Conditional Formula Question
 
I have the following Columns (A and B) with binary output (1 and 0), such
that A and B would not both contain 1 but both could contain 0. What formula
would I use in column C that calculates % change between cells D1 and E1 only
when there has been a 1 in A and followed by a 1 in B. See example:
A B C
1 0 0.00%
1 0 0.00%
1 0 0.00%
0 0 0.00%
0 1 3.00%
0 1 0.00%
0 1 0.00%
1 0 0.00%
0 1 3.00%
0 1 0.00%

Thanks

Fred Smith

Conditional Formula Question
 
An If statement testing the two conditions should work:

=if(and(b2=1,a1=1),(e1-d1)/d1,0)

--
Regards,
Fred


"iperlovsky" wrote in message
...
I have the following Columns (A and B) with binary output (1 and 0), such
that A and B would not both contain 1 but both could contain 0. What formula
would I use in column C that calculates % change between cells D1 and E1 only
when there has been a 1 in A and followed by a 1 in B. See example:
A B C
1 0 0.00%
1 0 0.00%
1 0 0.00%
0 0 0.00%
0 1 3.00%
0 1 0.00%
0 1 0.00%
1 0 0.00%
0 1 3.00%
0 1 0.00%

Thanks





All times are GMT +1. The time now is 07:50 PM.

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