ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   compute count of range of date fields with a given year (https://www.excelbanter.com/excel-discussion-misc-queries/167738-compute-count-range-date-fields-given-year.html)

Excel formula

compute count of range of date fields with a given year
 
I would like to count the number of date cells in a range with a specific
year. For instance, I would like to do

COUNTIF(cell range, year(current cell) = 2007)

pinmaster

compute count of range of date fields with a given year
 
Hi,

Try this:

=SUMPRODUCT(--(YEAR(A1:A100)=2007))

or something like this array formula

=SUM(IF(YEAR(A5:A18)=2007,1))
enter using Ctrl+Shift+Enter

Regards!
Jean-Guy

"Excel formula" wrote:

I would like to count the number of date cells in a range with a specific
year. For instance, I would like to do

COUNTIF(cell range, year(current cell) = 2007)



All times are GMT +1. The time now is 09:58 PM.

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