Johanna
Johanna

Reputation: 1039

Excel 2007 COUNTIF in even rows only

I have an array of cells (C2:D43) in which I want to count the number of times a particular string ("filler") occurs. However, I only want to consider the even rows in my array (so basically, the array is C2:D2;C4:D4, etc.). How can I do this? I'm working with Excel 2007.

Upvotes: 0

Views: 1840

Answers (2)

114
114

Reputation: 926

Try using MOD(ROW(),2)=0 to split up your cells so that your array has two sets: even and odd cells. Then find a way to tell Excel to choose only the values that are the opposite value of the one evaluated at the first row of the array. I'll see if I can find a way to formalize this.

Upvotes: -1

Doug Glancy
Doug Glancy

Reputation: 27478

This SUMPRODUCT formula will do it:

=SUMPRODUCT((C2:D43="filler")*(MOD(ROW(C2:D43),2)=0))

Upvotes: 2

Related Questions