Counting "rows", i.e. simultaneous criteria for multiple cells

  • Thread starter Thread starter gkline
  • Start date Start date
G

gkline

I'm trying to count the number of cells meeting certain criteria, but b
applying multiple criteria to more than one column of cells. Basically
this would be the equivalent of row counting.

So, assuming I have Column A having letters "A", "B", "C", etc., an
Column B having numbers 1, 2, 3, etc., I'd like to be able to coun
unique combinations of values in the two columns.

# ColA ColB
1 A 1
2 A 1
3 A 2
4 A 2
5 B 1
6 B 2
7 C 1
8 D 1

Something like COUNTIF(A1:A8,"A"+B1:B8,1).
The result would be 2, as there are 2 rows with ColA="A", ColB=1.

Microsoft only shows examples of doing this with one range. I'm hopin
there's a relatively simple notation for combining ranges, withou
having to dig into VBScript. Any ideas? Thanks
 
=SUMPRODUCT(--(A1:A8="A"),--(B1:B8=1))

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top