Ask Your Question

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

asked 2012-11-12 09:00:46 +0200

anonymous user


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 flag offensive 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

1 Answer

Sort by » oldest newest most voted

answered 2012-11-12 10:13:33 +0200

JohnSUN gravatar image

updated 2012-11-12 10:14:19 +0200

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

edit flag offensive delete link more

Question Tools


Asked: 2012-11-12 09:00:46 +0200

Seen: 88 times

Last updated: Nov 12 '12