Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SRL SRL is offline
external usenet poster
 
Posts: 1
Default COUNTIF with Dates

I have two spreadsheets set up. One will be filled individually by employees
and the other will be used by management to track progress.
In the employees spreadsheet I have the following dates:
10/23/2008
10/27/2008
10/29/2008
10/28/2008
11/3/2008

In the management spreadsheet there will be two cells that they will modify
based on the reporting period desired
Start Date: 10/27/08 (this data is in A2)
End Date: 10/31/08 (this data is in B2)
I've been attempting to use COUNTIF to count the instances in which the
date is start date but <end date. I have tried several combinations to no
avail.
first: =COUNTIF(range,"A2<B2")
I am hoping for a result of 3, but always get back 0.
I also tried: =countif(range,"A2")-countif(range,"B2")
Result is also 0.

Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default COUNTIF with Dates

I have used a similar function to what you need.
=COUNTIFS(A1:A100,"=9/28/2008",A1:A100,"<=12/27/2008")

Make sure you choose the COUNTIFS with the because you have 2 dates to
include in the function.

"SRL" wrote:

I have two spreadsheets set up. One will be filled individually by employees
and the other will be used by management to track progress.
In the employees spreadsheet I have the following dates:
10/23/2008
10/27/2008
10/29/2008
10/28/2008
11/3/2008

In the management spreadsheet there will be two cells that they will modify
based on the reporting period desired
Start Date: 10/27/08 (this data is in A2)
End Date: 10/31/08 (this data is in B2)
I've been attempting to use COUNTIF to count the instances in which the
date is start date but <end date. I have tried several combinations to no
avail.
first: =COUNTIF(range,"A2<B2")
I am hoping for a result of 3, but always get back 0.
I also tried: =countif(range,"A2")-countif(range,"B2")
Result is also 0.

Any ideas?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default COUNTIF with Dates

First of all, according to your explanation, your logic is off.

You say you want count the dates *greater then* the start date,
AND
*less then* the end date.

That leaves only 2 dates in your posted example.

Assuming that you really want to *include* the start and end dates in the
count, try this:

=Countif(range,"="&A2)-Countif(range,""&B2)

OR

=Sumproduct((range=A2)*(range<=B2))
--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===


"SRL" wrote in message
...
I have two spreadsheets set up. One will be filled individually by
employees
and the other will be used by management to track progress.
In the employees spreadsheet I have the following dates:
10/23/2008
10/27/2008
10/29/2008
10/28/2008
11/3/2008

In the management spreadsheet there will be two cells that they will modify
based on the reporting period desired
Start Date: 10/27/08 (this data is in A2)
End Date: 10/31/08 (this data is in B2)
I've been attempting to use COUNTIF to count the instances in which the
date is start date but <end date. I have tried several combinations to no
avail.
first: =COUNTIF(range,"A2<B2")
I am hoping for a result of 3, but always get back 0.
I also tried: =countif(range,"A2")-countif(range,"B2")
Result is also 0.

Any ideas?


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default COUNTIF with Dates

Hi,

Regarding the COUNTIFS suggestion - that is new to 2007, so don't try it in
2003 or earlier.

I like the SUMPRODUCT solution but it may be a little obscure so as an
alternative you could use

=COUNTIF(Range,"="&B2)-COUNTIF(Range,""&A2)

where A2 is the end date and B2 is the start date.

If this helps, please click the Yes button.
--
Thanks,
Shane Devenshire


"SRL" wrote:

I have two spreadsheets set up. One will be filled individually by employees
and the other will be used by management to track progress.
In the employees spreadsheet I have the following dates:
10/23/2008
10/27/2008
10/29/2008
10/28/2008
11/3/2008

In the management spreadsheet there will be two cells that they will modify
based on the reporting period desired
Start Date: 10/27/08 (this data is in A2)
End Date: 10/31/08 (this data is in B2)
I've been attempting to use COUNTIF to count the instances in which the
date is start date but <end date. I have tried several combinations to no
avail.
first: =COUNTIF(range,"A2<B2")
I am hoping for a result of 3, but always get back 0.
I also tried: =countif(range,"A2")-countif(range,"B2")
Result is also 0.

Any ideas?

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
Countif between two dates AOP Excel Discussion (Misc queries) 3 November 11th 07 05:05 PM
CountIF with dates Secret Squirrel Excel Discussion (Misc queries) 13 November 15th 06 09:08 PM
using countif to add dates jwmillzy Excel Discussion (Misc queries) 2 June 2nd 06 06:27 PM
Countif using dates Bugaglugs Excel Worksheet Functions 11 August 23rd 05 05:16 PM
countif and dates JAF New Users to Excel 2 December 3rd 04 04:45 PM


All times are GMT +1. The time now is 07:37 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"