I am familiar with using array formulas, sumproduct(), sumif(), sumifs()... and using ranges or arrays in these formulas.
But still, I cannot manage to solve a particular "create a summary" problem.
I am using Excel 2007, my input data is as follows:
input.png
The requested summary is shown in the 3rd example in the below screen shot
result.png
Note that, to refer to the months, I use a criteria referring to the start and end dates of the month. Basically I want to kind of intersect the dates of a given month, with the rows of a given region, and count how many columns (dates) of that intersection have at least one value in the rows that differs from zero.
The formula for the first table (summing the numbers) is
{=SUM(--(AreaRange=$A23)*--(DateRange>=B$21)*--(DateRange<=B$22)*rawData)}
The formula for the second table (counting the total number of values different from zero) is
{=SUM(--(AreaRange=$A29)*--(DateRange>=B$27)*--(DateRange<=B$28)*--(rawData>0))}
In the 3rd table, the result for South for June should be 2, because on 2 dates in June, there is at least one number different from zero. How can I tell Excel 2007 that I want this result?
The sample file is attached.
Any help is greatly appreciated!
Bookmarks