Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Count times between 2 times and 2 dates

This is difficult and I'm lost! Here is the data (omitting not needed)

A D E
Control # Date Time



2 questions:

1. What formula would I use if I wanted to find out the number of #'s
ocurring on Monday between 1/1/06 and 3/31/06 (1st quarter of the year).
1.a IS there a way not to count diplicates of the control #
only... it would
be ok to count duplicate dates, just not duplicate of
control #'s -
which could occur unfortunately becuase of the way the
data is used.

2. What formula would I use if I wanted to find out the number of #'s
occurring between 0000 hours and 0400 hours between 1/1/06 and 3/31/06?
2.a SAME as 1.a


I tried using the sumproduct formula and am completely screwing that up...
please help!
  #2   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Count times between 2 times and 2 dates

Assume data in the table (cols A, D, E) is from row2 to row100,
col D contains real dates,
col E contains time expressed as text numbers, eg: "0000", "0100", etc

Use 2 empty cols to the right, say, cols G & H
Put in G2: =A2&"_"&D2
Put in H2: =IF(COUNTIF($G$2:G2,G2)1,"","x")
Select G2:H2, copy down to H100
(Col H will flag unique "Control # - Date" with an "x")

Then, to extract the the number of Control #'s
ocurring on Monday between 1/1/06 and 3/31/06
(counting only unique "Control # - Date")

we could put in say, I2:

=SUMPRODUCT((H2:H100="x")*(WEEKDAY(D2:D100)=1)*(D2 :D100= --"1-Jan-2006")*(D
2:D100<= --"31-Mar-2006"))

And to retrieve the number of Control #'s occurring
between 0000 hours and 0400 hours
between 1/1/06 and 3/31/06
(again, counting only unique "Control # - Date")

we could put in say, J2:

=SUMPRODUCT((H2:H100="x")*(E2:E100= "0000")*(E2:E100<=
"0400")*(D2:D100= --"1-Jan-2006")*(D2:D100<= --"31-Mar-2006"))

Adapt the ranges to suit
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Jeremy Ellison" wrote in message
...
This is difficult and I'm lost! Here is the data (omitting not needed)

A D E
Control # Date Time



2 questions:

1. What formula would I use if I wanted to find out the number of #'s
ocurring on Monday between 1/1/06 and 3/31/06 (1st quarter of the year).
1.a IS there a way not to count diplicates of the control #
only... it would
be ok to count duplicate dates, just not duplicate of
control #'s -
which could occur unfortunately becuase of the way the
data is used.

2. What formula would I use if I wanted to find out the number of #'s
occurring between 0000 hours and 0400 hours between 1/1/06 and 3/31/06?
2.a SAME as 1.a


I tried using the sumproduct formula and am completely screwing that up...
please help!



  #3   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Count times between 2 times and 2 dates

And if we don't want to count only unique "Control # - Date"'s
just remove this condition from the formula: .. (H2:H100="x")* ..
viz., use:

In I2:
=SUMPRODUCT((WEEKDAY(D2:D100)=1)*
(D2:D100= --"1-Jan-2006")*(D2:D100<= --"31-Mar-2006"))

In J2:
=SUMPRODUCT((E2:E100= "0000")*(E2:E100<="0400")*
(D2:D100= --"1-Jan-2006")*(D2:D100<= --"31-Mar-2006"))

--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--


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
Calculate times between dates and times in Excel Helio Excel Discussion (Misc queries) 1 March 25th 10 04:29 AM
count text appear how many times & put in respec col??eg 1st times Piglet Excel Discussion (Misc queries) 3 May 29th 08 07:53 AM
Count No. of times Dates are repeated Mandeep Dhami Excel Discussion (Misc queries) 6 December 8th 05 02:55 AM
Calculation of hourly rate times hours times 1.5 Newbusinessbod Excel Worksheet Functions 1 December 6th 05 04:44 PM
How are relay leg times or driving times entered and totaled? commissioner Excel Worksheet Functions 1 July 26th 05 09:27 PM


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