PC Review


Reply
Thread Tools Rate Thread

count between two dates

 
 
capt
Guest
Posts: n/a
 
      10th Dec 2007
I have the following formula.

=IF($A6="","",COUNTIF(MAIN!$B$10:$B$4999,"" &$A6 & ""))

How do I count between two dates in cells: P3 and R3?
--
capt
 
Reply With Quote
 
 
 
 
Max
Guest
Posts: n/a
 
      10th Dec 2007
Try something like this:
=IF(COUNT(P3,R3)<2,"",SUMPRODUCT((MAIN!$B$10:$B$4999>=P3)*(MAIN!$B$10:$B$4999<=R3)))
where P3, R3 houses the start and end dates
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"capt" wrote:
> I have the following formula.
>
> =IF($A6="","",COUNTIF(MAIN!$B$10:$B$4999,"" &$A6 & ""))
>
> How do I count between two dates in cells: P3 and R3?
> --
> capt

 
Reply With Quote
 
Tim879
Guest
Posts: n/a
 
      10th Dec 2007

From your post below - I wasn't really sure what you were looking
for....

If you're looking for the # of days between 2 dates, you can just
subtract Date 1 from Date 2. If you're looking for the number of
working days, enable the Analysis Toolpack Addin (tools -> Addins ->
Anaysis Toolpack) and then use the networkdays() function to calculate
the number of days, excluding weekends, between the 2 dates.

If you are looking for the number of rows of data between 2 dates on
your spreadsheet, the following will work:

Assume you have dates in Cells A1: A6 as follows:
1/1/2007
2/1/2007
2/15/2007
3/1/2007
4/9/2007
12/31/2007



In cells B1 and B2 I put the 2 dates you want to search between
2/1/2007
3/1/2007



This formula counts the # rows between the 2 dates entered:
=COUNTIF($A$1:$A$6,">="&B1)-COUNTIF($A$1:$A$6,">"&B2)





On Dec 10, 9:55 am, capt <c...@discussions.microsoft.com> wrote:
> I have the following formula.
>
> =IF($A6="","",COUNTIF(MAIN!$B$10:$B$4999,"" &$A6 & ""))
>
> How do I count between two dates in cells: P3 and R3?
> --
> capt


 
Reply With Quote
 
Bernard Liengme
Guest
Posts: n/a
 
      10th Dec 2007
The formula you show counts how many times the B range in the Main worksheet
match the value in A6 of the sheet where the formula resides. If A6 is empty
you see a blank cell.

Now tell us what you mean by: How do I count between two dates in cells: P3
and R3?

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

"capt" <(E-Mail Removed)> wrote in message
news:9AB1DE33-351D-4AF7-A3D3-(E-Mail Removed)...
>I have the following formula.
>
> =IF($A6="","",COUNTIF(MAIN!$B$10:$B$4999,"" &$A6 & ""))
>
> How do I count between two dates in cells: P3 and R3?
> --
> capt



 
Reply With Quote
 
capt
Guest
Posts: n/a
 
      10th Dec 2007
In cells P3 and R3 I insert a date From and To. The B range is where I find
the Names of clients. cell A6 will carry one of the names of the client.
I after to count how many entries there are of a client, in col B, between
two dates.

Thank you
--
capt


"Bernard Liengme" wrote:

> The formula you show counts how many times the B range in the Main worksheet
> match the value in A6 of the sheet where the formula resides. If A6 is empty
> you see a blank cell.
>
> Now tell us what you mean by: How do I count between two dates in cells: P3
> and R3?
>
> best wishes
> --
> Bernard V Liengme
> Microsoft Excel MVP
> www.stfx.ca/people/bliengme
> remove caps from email
>
> "capt" <(E-Mail Removed)> wrote in message
> news:9AB1DE33-351D-4AF7-A3D3-(E-Mail Removed)...
> >I have the following formula.
> >
> > =IF($A6="","",COUNTIF(MAIN!$B$10:$B$4999,"" &$A6 & ""))
> >
> > How do I count between two dates in cells: P3 and R3?
> > --
> > capt

>
>
>

 
Reply With Quote
 
Bernard Liengme
Guest
Posts: n/a
 
      10th Dec 2007
And where are the dates relative to the B range? We need to know what you
data looks like.
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"capt" <(E-Mail Removed)> wrote in message
news:9AAF13FF-3814-4D36-930C-(E-Mail Removed)...
> In cells P3 and R3 I insert a date From and To. The B range is where I
> find
> the Names of clients. cell A6 will carry one of the names of the client.
> I after to count how many entries there are of a client, in col B, between
> two dates.
>
> Thank you
> --
> capt
>
>
> "Bernard Liengme" wrote:
>
>> The formula you show counts how many times the B range in the Main
>> worksheet
>> match the value in A6 of the sheet where the formula resides. If A6 is
>> empty
>> you see a blank cell.
>>
>> Now tell us what you mean by: How do I count between two dates in cells:
>> P3
>> and R3?
>>
>> best wishes
>> --
>> Bernard V Liengme
>> Microsoft Excel MVP
>> www.stfx.ca/people/bliengme
>> remove caps from email
>>
>> "capt" <(E-Mail Removed)> wrote in message
>> news:9AB1DE33-351D-4AF7-A3D3-(E-Mail Removed)...
>> >I have the following formula.
>> >
>> > =IF($A6="","",COUNTIF(MAIN!$B$10:$B$4999,"" &$A6 & ""))
>> >
>> > How do I count between two dates in cells: P3 and R3?
>> > --
>> > capt

>>
>>
>>



 
Reply With Quote
 
capt
Guest
Posts: n/a
 
      10th Dec 2007
Below is a small part of the table. I need to count each client (col B)
relative to the dates.
ie between 5-sep-07 and 10-sep-07
client A = 4
client B = 3

A B C D
Date Client Hours Total
5-Sep-07 A 5:20 5:20
7-Sep-07 B 5:15 10:35
8-Sep-07 A 10:05 20:40
9-Sep-07 B 0:35 21:15
9-Sep-07 B 7:40 28:55
9-Sep-07 A 0:15 29:10
10-Sep-07 A 0:15 29:25
and so on.....

--
capt


"Bernard Liengme" wrote:

> And where are the dates relative to the B range? We need to know what you
> data looks like.
> --
> Bernard V Liengme
> Microsoft Excel MVP
> www.stfx.ca/people/bliengme
> remove caps from email
>
> "capt" <(E-Mail Removed)> wrote in message
> news:9AAF13FF-3814-4D36-930C-(E-Mail Removed)...
> > In cells P3 and R3 I insert a date From and To. The B range is where I
> > find
> > the Names of clients. cell A6 will carry one of the names of the client.
> > I after to count how many entries there are of a client, in col B, between
> > two dates.
> >
> > Thank you
> > --
> > capt
> >
> >
> > "Bernard Liengme" wrote:
> >
> >> The formula you show counts how many times the B range in the Main
> >> worksheet
> >> match the value in A6 of the sheet where the formula resides. If A6 is
> >> empty
> >> you see a blank cell.
> >>
> >> Now tell us what you mean by: How do I count between two dates in cells:
> >> P3
> >> and R3?
> >>
> >> best wishes
> >> --
> >> Bernard V Liengme
> >> Microsoft Excel MVP
> >> www.stfx.ca/people/bliengme
> >> remove caps from email
> >>
> >> "capt" <(E-Mail Removed)> wrote in message
> >> news:9AB1DE33-351D-4AF7-A3D3-(E-Mail Removed)...
> >> >I have the following formula.
> >> >
> >> > =IF($A6="","",COUNTIF(MAIN!$B$10:$B$4999,"" &$A6 & ""))
> >> >
> >> > How do I count between two dates in cells: P3 and R3?
> >> > --
> >> > capt
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Max
Guest
Posts: n/a
 
      10th Dec 2007
Something like this should work for you:

In say, T3:
=IF(COUNTA(P3,R3,S3)<3,"",SUMPRODUCT((MAIN!$A$10:$A$4999>=P3)*(MAIN!$A$10:$A$4999<=R3)*(MAIN!$B$10:$B$4999=S3))

where P3, R3 houses the start and end dates,
S3 contains the client, eg: A

Adapt the ranges to suit
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"capt" wrote:
> Below is a small part of the table. I need to count each client (col B)
> relative to the dates.
> ie between 5-sep-07 and 10-sep-07
> client A = 4
> client B = 3
>
> A B C D
> Date Client Hours Total
> 5-Sep-07 A 5:20 5:20
> 7-Sep-07 B 5:15 10:35
> 8-Sep-07 A 10:05 20:40
> 9-Sep-07 B 0:35 21:15
> 9-Sep-07 B 7:40 28:55
> 9-Sep-07 A 0:15 29:10
> 10-Sep-07 A 0:15 29:25
> and so on.....


 
Reply With Quote
 
capt
Guest
Posts: n/a
 
      11th Dec 2007
Brilliant Max it works fine.
Thank you
--
capt


"Max" wrote:

> Something like this should work for you:
>
> In say, T3:
> =IF(COUNTA(P3,R3,S3)<3,"",SUMPRODUCT((MAIN!$A$10:$A$4999>=P3)*(MAIN!$A$10:$A$4999<=R3)*(MAIN!$B$10:$B$4999=S3))
>
> where P3, R3 houses the start and end dates,
> S3 contains the client, eg: A
>
> Adapt the ranges to suit
> --
> Max
> Singapore
> http://savefile.com/projects/236895
> xdemechanik
> ---
> "capt" wrote:
> > Below is a small part of the table. I need to count each client (col B)
> > relative to the dates.
> > ie between 5-sep-07 and 10-sep-07
> > client A = 4
> > client B = 3
> >
> > A B C D
> > Date Client Hours Total
> > 5-Sep-07 A 5:20 5:20
> > 7-Sep-07 B 5:15 10:35
> > 8-Sep-07 A 10:05 20:40
> > 9-Sep-07 B 0:35 21:15
> > 9-Sep-07 B 7:40 28:55
> > 9-Sep-07 A 0:15 29:10
> > 10-Sep-07 A 0:15 29:25
> > and so on.....

>

 
Reply With Quote
 
Max
Guest
Posts: n/a
 
      11th Dec 2007
welcome, glad it helped.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"capt" <(E-Mail Removed)> wrote in message
news:43D3E863-C4C4-4664-A8BD-(E-Mail Removed)...
> Brilliant Max it works fine.
> Thank you



 
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 Occurences of Dates Between Two Dates EMB369 Microsoft Excel Worksheet Functions 0 25th Mar 2010 11:49 AM
Count Dates between Dates exclude Text Ken Microsoft Excel Misc 3 8th Apr 2009 07:59 PM
I want to count the total Number of dates between two dates How? seshu Microsoft Excel Worksheet Functions 3 7th Feb 2008 05:41 PM
need to convert list of dates to count no. of dates by week neowok Microsoft Excel Worksheet Functions 13 30th Jan 2006 03:54 PM
How do I get a number count of dates that fall between specific dates JohnB Microsoft Excel Discussion 3 3rd Jun 2004 03:26 PM


Features
 

Advertising
 

Newsgroups
 


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