Hi matt_the_brum!
I'm afraid that the big defect / limitation of COUNTIF and SUMIF is
that they will only handle one criteria. They don't even allow for an
AND or OR as the criteria.
We need to use other functions for this and perhaps the most commonly
used is SUMPRODUCT.
In this case I have dates recognised as dates by Excel in column A. I
have my amounts in column B. In C, D, E, and F I have my x's (letters
that is, not ex-wives)
Under column C I use:
=SUMPRODUCT((MONTH($A$1:$A$16)=1)*(C1:C16="x")*($B$1:$B$16))
Copy across under D,E and F
You might regard the two criteria structures within the SUMPRODUCT
formula as being implicit IF functions that resolve to 1 if TRUE and 0
if FALSE. Only if both are TRUE will you get 1*1* B_value added to the
sum of the products.
I could do better if I substitute 1 by a cell reference immediately to
the left of my formula (e.g.) use $B18. Then in B18 down to B29 I have
the month numbers. That allows me to copy across and down to get a
table.
Although I might start off with this under the data, after it is all
working sweetly I cut and paste to a more convenient location.
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
[email protected]
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.