"countif" and "and" functions

P

PamO

Is it possible to use a "countif" function with an "and"
function which will give the numeric value of cells in
different columns, but the same rows, that meet the
criteria?
 
M

Max

One way is to use SUMPRODUCT instead

Example:

In E1: =SUMPRODUCT((A1:A4="a")*(B1:B4="c"))

will count the number of instances in which:

"a" occurs in A1:A4
*and*
"c" occurs in B1:B4

Note that the ranges A1:A4, B1:B4 have to be similar
and you can't use entire col refs (A:A, B:B) in SUMPRODUCT

The formula can be expanded to cover > 2 criteria, e.g.:
=SUMPRODUCT((A1:A4="a")*(B1:B4="c")*(C1:C4="d"))
 

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

Top