ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Does the COUNTIF criteria parameter accepts functions? (https://www.excelbanter.com/excel-worksheet-functions/188468-does-countif-criteria-parameter-accepts-functions.html)

[email protected]

Does the COUNTIF criteria parameter accepts functions?
 
I'm trying to use a function (WEEKNUM) as the criteria for a range in
COUNTIF. Is this possible?

Bob Phillips

Does the COUNTIF criteria parameter accepts functions?
 
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)



wrote in message
...
I'm trying to use a function (WEEKNUM) as the criteria for a range in
COUNTIF. Is this possible?




Pete_UK

Does the COUNTIF criteria parameter accepts functions?
 
Try with SUMPRODUCT.

Pete

On May 22, 6:52*am, wrote:
I'm trying to use a function (WEEKNUM) as the criteria for a range in
COUNTIF. *Is this possible?



Bob Phillips

Does the COUNTIF criteria parameter accepts functions?
 
See my comment on SP.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Pete_UK" wrote in message
...
Try with SUMPRODUCT.

Pete

On May 22, 6:52 am, wrote:
I'm trying to use a function (WEEKNUM) as the criteria for a range in
COUNTIF. Is this possible?





All times are GMT +1. The time now is 11:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com