## Count cells w/values in column if the data in column a matches cri

### Count cells w/values in column if the data in column a matches cri

I need a formula that counts the number of cell that contain data in column B
as long as the corresponding cell in column A matches a given criteria.

### Count cells w/values in column if the data in column a matches cri

Try this:

=SUMPRODUCT((A1:A100=D1)*(B1:B100<>""))

where D1 contains the criteria.

Hope this helps.

Pete

### Count cells w/values in column if the data in column a matches cri

Hi,

=SUMPRODUCT(--(A:A=C1),--(B:B<>""))

Here the criteria is in C1.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire

### Count cells w/values in column if the data in column a matches cri

That will only work in XL2007 (earlier versions need delimited column ranges
for its arrays). I think I would use delimited ranges even in XL2007
however... not sure how efficient it would be to let array calculations
extend across one million plus rows.

--
Rick (MVP - Excel)

"Shane Devenshire" < XXXX@XXXXX.COM > wrote in