W williambbradley May 22, 2008 #1 I'm trying to use a function (WEEKNUM) as the criteria for a range in COUNTIF. Is this possible?
B Bob Phillips May 22, 2008 #2 No you can't, and you cannot even use it in SUMPRODUCT because WEEKNUM will not handle an array of dates. So you have to craft your own =SUMPRODUCT(--(1+INT(($A$2:$A$20-(DATE(YEAR($A$2:$A$20),1,2)-WEEKDAY(DATE(YEAR($A$2:$A$20),1,1))))/7)=1)) -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy)
No you can't, and you cannot even use it in SUMPRODUCT because WEEKNUM will not handle an array of dates. So you have to craft your own =SUMPRODUCT(--(1+INT(($A$2:$A$20-(DATE(YEAR($A$2:$A$20),1,2)-WEEKDAY(DATE(YEAR($A$2:$A$20),1,1))))/7)=1)) -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy)
B Bob Phillips May 22, 2008 #4 See my comment on SP. -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) Try with SUMPRODUCT. Pete
See my comment on SP. -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) Try with SUMPRODUCT. Pete