PDA

View Full Version : Solved: Counting cells in one column based on values in a different column.



ironj32
12-03-2009, 07:20 AM
Sorry if this been asked and answered before, but I've done a lot of searches and cannot find anything.

In the example below, I need to try to take a Count of ColC IF ColB=1. So the result from the two columns below would be 3.

ColB ColC
1 100%
2 99%
4
3 90%
1
4 100%
1 98%
1 100%

I've tried the following formulas but have not had any success.
=COUNT($C:$C,$B:$B=1)
=IF(B:B=1,COUNT(!C:C))
=COUNTA(IF($B:$B=1,$C:$C))
=COUNTIF($C:$C,$B:$B=1)

Any help would be greatly appreciated!

mikerickson
12-03-2009, 07:28 AM
If you want to count the number of cells in B that have one
=COUNTIF(B:B, 1)

If you want to sum the values in column C where the column B value in the same row is 1

=SUMIF(B:B, 1 , C:C)

ironj32
12-03-2009, 07:31 AM
I want to take a Count of the cells in C that are <>"" IF the corresponding cell in B=1

Bob Phillips
12-03-2009, 07:33 AM
Try

=SUMPRODUCT(--(B2:B20=1),--(C2:C20<>""))

ironj32
12-03-2009, 07:38 AM
Thanks XLD!