How would I go about writing a better formula for this one. It is part of the same worksheet from above.

the count function works because it is summarized by a pivot. But how do I hardcode this to the data source?

COUNT OF MONTHS.PNG

So essentially I only want the values in column (I) to be part of the count. Perhaps something like a countifs?

Count the number of months (column A) within a year (column B) then only count values in Column (I). So if month 1,2,3 in 2016 have values in column I, then count all 12 but only return a 3 for the months with values.

countifs.PNG