skinfreak
Board Regular
- Joined
- May 23, 2003
- Messages
- 152
I have a sumproduct formula which is causing me grief. The first works fine:
I also duplicate this but for the contents of cell G2. I also need the result of all other cells whose Year is equal to that of cell B3, but not equal to G1 or G2 even if it is blank.
I tried this, but it does not work:
What this probduces is a total which makes little sense to me. What I think it is doing is saying "count up if col G in sheet "Data" does not contain either G1 or G2, but if the date equals B3". Is this right?
Code:
=SUMPRODUCT(--(Data!$G$5:$G$23000=$G1),--(YEAR(Data!$I$5:$I$23000)=B$3))
I also duplicate this but for the contents of cell G2. I also need the result of all other cells whose Year is equal to that of cell B3, but not equal to G1 or G2 even if it is blank.
I tried this, but it does not work:
Code:
=SUMPRODUCT(((Data!$G$5:$G$23000<>G1)+(Data!$G$5:$G$23000<>G2))*(YEAR(Data!$I$5:$I$23000)=Output!B$3))
What this probduces is a total which makes little sense to me. What I think it is doing is saying "count up if col G in sheet "Data" does not contain either G1 or G2, but if the date equals B3". Is this right?