Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
KC KC is offline
external usenet poster
 
Posts: 107
Default Date Range Calculation

I need to calulate how many cells in one column have a date that are between
a range of dates for example 1/1/2005 through 12/31/2005.

Thanks.


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Date Range Calculation

=countif(a1:a10,"="&date(2005,1,1))-countif(a1:a10,""&date(2005,12,31))

KC wrote:

I need to calulate how many cells in one column have a date that are between
a range of dates for example 1/1/2005 through 12/31/2005.

Thanks.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Date Range Calculation

I'm a big fan of array formulas... hopefully you are familiar with
them. Below is the formula I used:

=SUM(IF(A2:A778=D3,IF(A2:A778<=D4,1,0),0))

A2:A778 -- was my range of dates
D3 -- cell with value of 1/1/2005
D4 -- cell with value of 12/31/2005

if you use this formula, after typing it, instead of just hitting enter
hit, ctrl-shift-enter... this makes it an array formula and it will put
{} around the formula.



KC wrote:
I need to calulate how many cells in one column have a date that are between
a range of dates for example 1/1/2005 through 12/31/2005.

Thanks.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default Date Range Calculation

Try something like this:

B1: 1/1/2005 (start date)
B2: 12/31/2005 (end date)
B3: =SUMPRODUCT((A1:A1000=B1)*(A1:A1000<=B2))

OR...to count all dates witin one year:
B3: =SUMPRODUCT(--(YEAR(A1:A1000)=2005))

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"KC" wrote:

I need to calulate how many cells in one column have a date that are between
a range of dates for example 1/1/2005 through 12/31/2005.

Thanks.


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Date Range Calculation


If it's a whole year like in your example then

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

or a specific month, e.g. December 2005

=SUMPRODUCT(--(TEXT(A1:A100,"mmm yy")="Dec 05"))

or for any date range where you have start date in H1 and end date in
H2

=SUMPRODUCT(--(A1:A100=H1),--(A1:A100<=H2))


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=566840



  #6   Report Post  
Posted to microsoft.public.excel.misc
KC KC is offline
external usenet poster
 
Posts: 107
Default Date Range Calculation

Awesome it worked. Thank you so much, this will save me so much time....

"Ron Coderre" wrote:

Try something like this:

B1: 1/1/2005 (start date)
B2: 12/31/2005 (end date)
B3: =SUMPRODUCT((A1:A1000=B1)*(A1:A1000<=B2))

OR...to count all dates witin one year:
B3: =SUMPRODUCT(--(YEAR(A1:A1000)=2005))

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"KC" wrote:

I need to calulate how many cells in one column have a date that are between
a range of dates for example 1/1/2005 through 12/31/2005.

Thanks.


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
Return info based on Date Range kermitforney Excel Worksheet Functions 3 July 11th 06 07:59 PM
Date Comparison Calculation PAR Excel Worksheet Functions 2 March 22nd 06 05:18 PM
how to check if date falls within range Bharat Saboo Excel Worksheet Functions 4 December 30th 05 10:31 AM
Date Range and calculation vgreen Excel Worksheet Functions 2 August 23rd 05 11:08 AM
adding occurrences for date range Mike Excel Discussion (Misc queries) 1 April 28th 05 09:14 PM


All times are GMT +1. The time now is 12:44 PM.

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"