Another one:
=sumproduct(--(text(a2:a100,"yyyymm")="200701")
Adjust the ranges to match--but you can't use whole columns (except in xl2007).
=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.
Bob Phillips explains =sumproduct() in much more detail here:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html
==========
But you may want to drop the formula approach and use data|pivottable (xl2003
menu).
You can group by month and year and get the summary report pretty quickly.
--Viewpoint wrote:
>
> I have a spreadsheet with dates in one column and data extends to columns to
> the right of the date. I need to do is count the number of cells that
> contains data within a date range (for each month within one year). Example:
>
> For the month of January 2007, count the number of cells that contains dates
> between 01/01/07-01/31/07.
>
> Any suggestions for how to create the correct formula?
--
Dave Peterson