excel find the count of 2 filtered columns

Viewed 32

There are paired columns that I am comparing(col1 and col2, col3 and col4) with either blank or '0' or '1'. I basically want to know how many are intersect

id   col1  col2   col3  col4
id1   0     1            
id2   1            1     0
id3         0      1     1 
id4                       
id5                0

for this table I want to count of how many ids are 0 or 1(between col1 and col2). If I use countA(b2:c4) I get 4 but I need to get 3 as only 3 ids are affected for each pair . Is therea formula that would actually give 3 for col1 and col2 and 3 for col3 and col4.

enter image description here

enter image description here

SUMPRODUCT(--(B$2:B$7+C$2:C$7=0)) 

fails here and provides 3 instead of 5

0 Answers
Related