# Countifs in two dimensional array, repeating header (non unique)

#### emichan

##### New Member
Hello,

I have a table like this:
 FY2014 FY2015 Count? Ticker Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 A 8/13/14 11/13/14 2/13/14 6/26/14 8/14/15 11/13/15 2/13/15 2 2 2 1 B 8/9/1514 11/14/14 2/13/14 6/26/14 8/7/15 11/13/15 2/14/15 6/13/15 2 2 2 2 C 2/12/13 5/10/13 8/9/14 12/13/14 2/10/15 5/9/15 2 2 1 1

<tbody>
</tbody>
I'm trying to count how many inputs i have for particular ticker, for particular quarter, with no regard to year.
That is, I want to get an output that shows for
A, Q1= 2
B, Q4= 2
C, Q3= 1

I tried getting a pivot table, but the problem is i don't have unique header names, so I get Q1, Q2, Q3, Q4 and then Q12, Q22, etc...

Is there a way to get countif which looks up criteria range, criteria, and count range, like sumifs?

Thank you!!

### Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

#### Jonmo1

##### MrExcel MVP
Which version of Excel are you using?
For XL2007+, try

=COUNTIFS(\$B\$2:\$I\$2,"Q1",INDEX(\$B\$2:\$I\$4,MATCH("A",\$A\$2:\$A\$4,0),0),"<>")

Last edited:

#### mikerickson

##### MrExcel MVP
=sumproduct(--(a3:a5="a")*(b2:i2="q4")*(b3:i5<>""))

#### Jonmo1

##### MrExcel MVP
Or based on the cell references for A and Q1

=COUNTIFS(\$B\$2:\$I\$2,K\$2,\$B3:\$I3,"<>")

Last edited:

#### emichan

##### New Member
Thank you both!
I knew it was a sumproduct!!
Thank you!

#### Jonmo1

##### MrExcel MVP
Try the countifs (i did have to adjust the ranges a bit)

Replies
2
Views
132
Replies
2
Views
49
Replies
8
Views
107
Replies
2
Views
98
Replies
3
Views
47

1,130,174
Messages
5,640,593
Members
417,152
Latest member
DayTimeSeby

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back