Count cells between 9 am and 5 pm in a month.

excelnewbie34

New Member
Joined
Apr 9, 2014
Messages
7
HI,
I receive data in the format below. I would like to check how many entries were there between 9 am and 5 pm for the range of date specified. Normally it is for a month(01/03/2014-31/03/2014). Is there a formula that I can use to find the total number of entries that fall within this period. I use excel 2007.
04/04/2014 22:51</SPAN>
04/04/2014 22:55</SPAN>
04/04/2014 23:21</SPAN>
05/03/2014 10:29</SPAN>
05/03/2014 10:52</SPAN>
05/03/2014 11:26</SPAN>
05/03/2014 14:35</SPAN>
05/03/2014 14:52</SPAN>
05/04/2014 10:03</SPAN>
05/04/2014 10:43</SPAN>
05/04/2014 16:39</SPAN>
05/04/2014 20:55</SPAN>
05/04/2014 21:28</SPAN>
05/04/2014 21:59</SPAN>
06/03/2014 09:41</SPAN>
06/03/2014 15:37</SPAN>
06/03/2014 17:35</SPAN>
06/04/2014 11:25</SPAN>
06/04/2014 12:44</SPAN>
06/04/2014 14:09



Thank you.

You are doing a great job by running this forum. Thanks you.</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
I can't really think of a different way to do it then by putting the start and end dates and times in separate cells...

Excel 2012
ABCDEF
1Dates and TimesFromToInOut
23/5/14 10:293/1/20143/31/20149:0017:00
33/5/14 10:52
43/5/14 11:267
53/5/14 14:35
63/5/14 14:52
73/6/14 9:41
83/6/14 15:37
93/6/14 17:35
104/4/14 22:51
114/4/14 22:55
124/4/14 23:21
134/5/14 10:03
144/5/14 10:43
154/5/14 16:39
164/5/14 20:55
174/5/14 21:28
184/5/14 21:59
194/6/14 11:25
204/6/14 12:44
214/6/14 14:09

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
D4=SUMPRODUCT((INT(A2:A21)>=C2)*(INT(A2:A21)<=D2)*(MOD(A2:A21,1)>=E2)*(MOD(A2:A21,1)<=F2))

<tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
4/4/2014 22:5109:008=SUMPRODUCT(--(--TEXT(A1:A20,"hh:mm")>=B1),--(--TEXT(A1:A20,"hh:mm")<=B2),--(A1:A20>=B3),--(A1:A20<=B4))
4/4/2014 22:5517:00
4/4/2014 23:211-May
5/3/2014 10:2931-May
5/3/2014 10:52
5/3/2014 11:26one more…
5/3/2014 14:35
5/3/2014 14:52
5/4/2014 10:03
5/4/2014 10:43
5/4/2014 16:39
5/4/2014 20:55
5/4/2014 21:28
5/4/2014 21:59
6/3/2014 09:41
6/3/2014 15:37
6/3/2014 17:35
6/4/2014 11:25
6/4/2014 12:44
6/4/2014 14:09
<colgroup><col width="210" style="width: 158pt; mso-width-source: userset; mso-width-alt: 7680;"> <col width="64" style="width: 48pt;"> <col width="27" style="width: 20pt; mso-width-source: userset; mso-width-alt: 987;"> <col width="64" style="width: 48pt;"> <col width="948" style="width: 711pt; mso-width-source: userset; mso-width-alt: 34669;"> <tbody> </tbody>
 
Upvote 0
i don't know, I flipped the dates to DMY because of month(01/03/2014-31/03/2014) so I assumed they were UK dates
 
Upvote 0
Thank you very much for fast reply. I tried both options. First one worked for me very well and yes I am using uk time.
Second one worked when I replicated the cells exactly the way as you shown, but didn't work for the spreadsheet. I must be doing something wrong there. I have to go back and try again with fresh eyes.
Thank you for finding time to help me with this, I have a long way to go before I even attempt to try something like this.
 
Upvote 0
Thank you very much for fast reply. I tried both options. First one worked for me very well and yes I am using uk time.
Second one worked when I replicated the cells exactly the way as you shown, but didn't work for the spreadsheet. I must be doing something wrong there. I have to go back and try again with fresh eyes.
Thank you for finding time to help me with this, I have a long way to go before I even attempt to try something like this.

'=SUMPRODUCT(--(--TEXT(A1:A20,"hh:mm") > =B1),--(--TEXT(A1:A20,"hh:mm") < =B2),--(A1:A20 > =B3),--(A1:A20 < =B4)) did you copy and paste the formula?
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top