PC Review


Reply
Thread Tools Rate Thread

Count number of cells containing a specific date range

 
 
--Viewpoint
Guest
Posts: n/a
 
      30th Dec 2007
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?
 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      30th Dec 2007
=COUNTIF(A1:A100,">="&DATE(2007,1,1))-COUNTIF(A1:A100,">="&DATE(2007,1,31))

--
Gary''s Student - gsnu200762


"--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?

 
Reply With Quote
 
Bernard Liengme
Guest
Posts: n/a
 
      30th Dec 2007
=SUMPRODUCT(--(MONTH(A1:A30)=1),--(YEAR(A1:A30)=2007))
For more details on SUMPRODUCT
Bob Phillips
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
J.E McGimpsey
http://mcgimpsey.com/excel/formulae/doubleneg.html

best wishes & Happy New Year
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"--Viewpoint" <(E-Mail Removed)> wrote in message
news:AE681FBF-C8D1-4B54-94F7-(E-Mail Removed)...
>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?



 
Reply With Quote
 
Ron Rosenfeld
Guest
Posts: n/a
 
      30th Dec 2007
On Sun, 30 Dec 2007 05:30:00 -0800, Gary''s Student
<(E-Mail Removed)> wrote:

>=COUNTIF(A1:A100,">="&DATE(2007,1,1))-COUNTIF(A1:A100,">="&DATE(2007,1,31))



Your formula is inconsistent.

It includes 1/1/07 but not 1/31/07.

I would think by "between" the OP probably meant to include both dates, as is
the "common" usage. Possibly he meant to exclude both dates, but I doubt that.

So either:

=COUNTIF(A1:A100,">="&DATE(2007,1,1))-COUNTIF(A1:A100,">"&DATE(2007,1,31))

or

=COUNTIF(A1:A100,">"&DATE(2007,1,1))-COUNTIF(A1:A100,">="&DATE(2007,1,31))

depending on which definition.
--ron
 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      30th Dec 2007
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
 
Reply With Quote
 
François
Guest
Posts: n/a
 
      30th Dec 2007
Hello,

I would rather more advise you to use two conditions, such as :
Cell(... or [A...])> to the first day of the selected month,
and the "Datedif function" -> Datedif(old date, new date, "m") <1 for a
single month choice ...

François

"--Viewpoint" <(E-Mail Removed)> a écrit dans le message
de news: AE681FBF-C8D1-4B54-94F7-(E-Mail Removed)...
>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?



 
Reply With Quote
 
ªá¥Ò¯Î
Guest
Posts: n/a
 
      1st Jan 2008
dsum

"--Viewpoint" <(E-Mail Removed)> ¼¶¼g©ó¶l¥ó·s»D:AE681FBF-C8D1-4B54-94F7-(E-Mail Removed)...
>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?



 
Reply With Quote
 
JohnR
Guest
Posts: n/a
 
      30th Dec 2009
what about:

=COUNTIFS(F57:F65,">=" & INDIRECT("B57"), F57:F65,"<=" & INDIRECT("B58"))

where F57:F65 is the date range, B57 is the start date and B58 is the end
date.

"ªá¥Ò¯Î" wrote:

> dsum
>
> "--Viewpoint" <(E-Mail Removed)> ¼¶¼g©ó¶l¥ó·s»D:AE681FBF-C8D1-4B54-94F7-(E-Mail Removed)...
> >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?

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count the number of times a specific date appears in a range of ce Louisa Microsoft Excel Worksheet Functions 6 19th May 2009 05:26 PM
Count the number of times a specific date appears in a range of ce Louisa Microsoft Excel Worksheet Functions 0 19th May 2009 11:50 AM
Count the number of cells containing a date within a range Scoffers Microsoft Excel Misc 5 24th Feb 2009 10:00 AM
count number occurring within specific date range =?Utf-8?B?RHVja3k=?= Microsoft Excel Worksheet Functions 1 11th Jul 2006 06:49 AM
Count if for # for how many cells contain a specific date range Bryan Microsoft Excel Worksheet Functions 4 26th Apr 2004 05:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:20 AM.