Abdallah Al Barmawi
Abdallah Al Barmawi

Reputation: 86

Excel, Get count if two cells have specifice value

i have an excel sheet with some test result(PPV Predictive Positive Value) like below, i want to find out the count if

enter image description here

Test1=1 Test2=1 count is 2
Test1=1 Test2=0 count is 1
Test1=0 Test2=1 count is 1
Test1=0 Test2=0 count is 1

Upvotes: 0

Views: 372

Answers (2)

PermaNoob
PermaNoob

Reputation: 869

If Test1 is in col A and Test2 is in col B, you could use a countifs formula like =countifs(A:A,1,B:B,1) for your first condition. Then, =countifs(A:A,1,B:B,0), =countifs(A:A,0,B:B,1), and =countifs(A:A,0,B:B,0) for your others.

The formula works by looking in col A for the condition you specify(1 or 0) and doing the same for col B, then only counting the ones that meet both criteria.

Upvotes: 0

ttaaoossuu
ttaaoossuu

Reputation: 7884

Let's assume your table starts in A1 cell. Write this in C2 cell:

=MAX(A2+B2,1)

Or if you are a Boolean maniac:

=AND(A2;B2)+1

Then count the sum at the bottom of the column.

Upvotes: 2

Related Questions