Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default counting the number of dates in a date range

I have a list of over 5000 birth dates i.e: 2/7/1975. I need to count the
number of times a cell has a date in a date range of years. For example I
need to know how many were born in the years 1927 thruogh 1937.

Scott
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default counting the number of dates in a date range

try
=sumproduct((year(a2:a5000)=1927)*(year(a2:a5000) <=1937))
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"smcmoran" wrote in message
...
I have a list of over 5000 birth dates i.e: 2/7/1975. I need to count the
number of times a cell has a date in a date range of years. For example I
need to know how many were born in the years 1927 thruogh 1937.

Scott


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default counting the number of dates in a date range

Well, with a little flexibility of counting for more than just years, you
could do the following:
=SUMPRODUCT(($A$2:$A$5001=firstdate)*($A$2:$A$500 1<=lastdate))

Hope this helps.
--
John C


"smcmoran" wrote:

I have a list of over 5000 birth dates i.e: 2/7/1975. I need to count the
number of times a cell has a date in a date range of years. For example I
need to know how many were born in the years 1927 thruogh 1937.

Scott

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default counting the number of dates in a date range

Thank you, That worked perfectly and very simply. I was trying to complicate
the formula too much.

"Don Guillett" wrote:

try
=sumproduct((year(a2:a5000)=1927)*(year(a2:a5000) <=1937))
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"smcmoran" wrote in message
...
I have a list of over 5000 birth dates i.e: 2/7/1975. I need to count the
number of times a cell has a date in a date range of years. For example I
need to know how many were born in the years 1927 thruogh 1937.

Scott



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default counting the number of dates in a date range

What if you wanted to look at specific quarter (i.e. a range of months within
a year)? I tried using
=SUMPRODUCT(((C2:C73)=01012008)*(MONTH(C2:C73)<=1 2312008))

with and without "month" and I got a zero, so clearly, I am not sure of the
format for the dates.


"Don Guillett" wrote:

try
=sumproduct((year(a2:a5000)=1927)*(year(a2:a5000) <=1937))
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"smcmoran" wrote in message
...
I have a list of over 5000 birth dates i.e: 2/7/1975. I need to count the
number of times a cell has a date in a date range of years. For example I
need to know how many were born in the years 1927 thruogh 1937.

Scott



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default counting the number of dates in a date range

To count dates that are in the a specific range...

Use cells to hold the date boundaries:

A1 = start date
B1 = end date

=SUMPRODUCT(--(C2:C73=A1),--(C2:C73<=B1))

--
Biff
Microsoft Excel MVP


"Axess08" wrote in message
...
What if you wanted to look at specific quarter (i.e. a range of months
within
a year)? I tried using
=SUMPRODUCT(((C2:C73)=01012008)*(MONTH(C2:C73)<=1 2312008))

with and without "month" and I got a zero, so clearly, I am not sure of
the
format for the dates.


"Don Guillett" wrote:

try
=sumproduct((year(a2:a5000)=1927)*(year(a2:a5000) <=1937))
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"smcmoran" wrote in message
...
I have a list of over 5000 birth dates i.e: 2/7/1975. I need to count
the
number of times a cell has a date in a date range of years. For
example I
need to know how many were born in the years 1927 thruogh 1937.

Scott





  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default counting the number of dates in a date range

Good Try, but it doesn't quite work. I keep either getting 0 or 72 (which is
the total number of cells). That's ok though. I think this is done better
with Access queries anyway. Thanks for your help!

"T. Valko" wrote:

To count dates that are in the a specific range...

Use cells to hold the date boundaries:

A1 = start date
B1 = end date

=SUMPRODUCT(--(C2:C73=A1),--(C2:C73<=B1))

--
Biff
Microsoft Excel MVP


"Axess08" wrote in message
...
What if you wanted to look at specific quarter (i.e. a range of months
within
a year)? I tried using
=SUMPRODUCT(((C2:C73)=01012008)*(MONTH(C2:C73)<=1 2312008))

with and without "month" and I got a zero, so clearly, I am not sure of
the
format for the dates.


"Don Guillett" wrote:

try
=sumproduct((year(a2:a5000)=1927)*(year(a2:a5000) <=1937))
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"smcmoran" wrote in message
...
I have a list of over 5000 birth dates i.e: 2/7/1975. I need to count
the
number of times a cell has a date in a date range of years. For
example I
need to know how many were born in the years 1927 thruogh 1937.

Scott





  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 622
Default counting the number of dates in a date range

Your problem is likely still the date format. Excel puts dates in as
an integer, counting days from 1/1/1900. Today, 11/4/2008, is 39756.
Then you can use a Date format to show it as a date.

I'm guessing your reference cells are values with date format, but the
other data, presumably downloaded from Access, is text. That won't
match. Either change the data to values or change the two reference
cells to text.
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default counting the number of dates in a date range

Hi,

MONTH(C2:C73)<=12312008


After the equal to sign, shouldn't there be a number (from 1-12) indicating
the month.

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Axess08" wrote in message
...
What if you wanted to look at specific quarter (i.e. a range of months
within
a year)? I tried using
=SUMPRODUCT(((C2:C73)=01012008)*(MONTH(C2:C73)<=1 2312008))

with and without "month" and I got a zero, so clearly, I am not sure of
the
format for the dates.


"Don Guillett" wrote:

try
=sumproduct((year(a2:a5000)=1927)*(year(a2:a5000) <=1937))
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"smcmoran" wrote in message
...
I have a list of over 5000 birth dates i.e: 2/7/1975. I need to count
the
number of times a cell has a date in a date range of years. For
example I
need to know how many were born in the years 1927 thruogh 1937.

Scott



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting Empty Dates within a Range? Gina[_2_] Excel Worksheet Functions 3 July 24th 08 06:03 PM
Counting number of observations within a date range? Nic Excel Worksheet Functions 7 April 20th 07 09:20 AM
Counting dates within a specified range MacAttack Excel Discussion (Misc queries) 1 December 7th 06 10:00 PM
Counting dates in a RANGE (yargh!) :) S Davis Excel Worksheet Functions 2 April 27th 06 03:01 AM
Counting Dates in a Range Matt7102 Excel Discussion (Misc queries) 9 January 13th 06 11:14 PM


All times are GMT +1. The time now is 05:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"