A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Counting dates within a range



 
 
Thread Tools Display Modes
  #1  
Old April 27th, 2010, 04:15 PM posted to microsoft.public.excel.worksheet.functions
towem3
external usenet poster
 
Posts: 1
Default Counting dates within a range

I have a large database of ~10,000 dated and timed entries. Each entry
represents the date and time of a hospital admission. I would like to know
for each entry, how many other events took place within 24 hours. I am trying
to figure out how many hospital admission happened in the 12 hours prior to
and after each admission to estimate the daily admission rate more accurately
than just by calendar day.

I have tried
=COUNTIFS(AV:AV,"="&(AV2+0.5),AV:AV,"="&(AV2-0.5))
Where AV is the column of all dates, and AV2 is the date in question. This
formula is not accurate, and I can't figure out why

I'm looking to make a data sheet such as below (I've figured out the
calendar day column), but I can't figure out how to do the 24h count.

Id# Date Calendar day count 24h count
1 1/1/10 12:00 2 2
2 1/1/10 23:00 2 4
3 1/2/10 01:30 3 3
4 1/2/10 11:00 3 3
5 1/2/10 14:00 3 2

Thank you for your help!
  #2  
Old April 27th, 2010, 05:23 PM posted to microsoft.public.excel.worksheet.functions
Bob Phillips[_3_]
external usenet poster
 
Posts: 489
Default Counting dates within a range

Try

=SUMPRODUCT(--(AV:AVAV2+0.5),--(AV:AV=AV2-0.5))

--

HTH

Bob

"towem3" wrote in message
...
I have a large database of ~10,000 dated and timed entries. Each entry
represents the date and time of a hospital admission. I would like to know
for each entry, how many other events took place within 24 hours. I am
trying
to figure out how many hospital admission happened in the 12 hours prior
to
and after each admission to estimate the daily admission rate more
accurately
than just by calendar day.

I have tried
=COUNTIFS(AV:AV,"="&(AV2+0.5),AV:AV,"="&(AV2-0.5))
Where AV is the column of all dates, and AV2 is the date in question. This
formula is not accurate, and I can't figure out why

I'm looking to make a data sheet such as below (I've figured out the
calendar day column), but I can't figure out how to do the 24h count.

Id# Date Calendar day count 24h count
1 1/1/10 12:00 2 2
2 1/1/10 23:00 2 4
3 1/2/10 01:30 3 3
4 1/2/10 11:00 3 3
5 1/2/10 14:00 3 2

Thank you for your help!



 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:01 AM.


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