# Counting the times multiple expressions on a row are met? [closed]

Anonymous

I have a table that looks something like this

#    A    B
1    1    3
2    2    3
3    2    1


I want to count the number of times Ax = 2 and Bx = 3. In this case, the result is 1, because only on row 2 are both the conditions met. I can use countif to find the number of times a column is equal 2, but I can't see how to only count it if it's neighbor also meets a condition. I suspect it might require using Array functions, but the documentation on this seem quite lacking and I've been unable to find any good tutorials for someone with a programming background. I will be very grateful for any help you can give me with solving this problem.

edit retag reopen merge delete

### Closed for the following reason the question is answered, right answer was accepted by Alex Kemp close date 2015-10-18 23:07:55.949888

Sort by » oldest newest most voted

1 Use array variant of function SUM:

{=SUM(($A$1:$A$3=2)*($B$1:$B$3=3))} (Ctrl+Shift+Enter!)


(See exaple of function SUM in Help )

2 Use function SUMPRODUCT

=SUMPRODUCT($A$1:$A$3=2;$B$1:$B$3=3)

more