Please help with counting cells with time criteria

Tonybaga

New Member
Joined
Oct 27, 2020
Messages
2
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
Hi everyone
This is the first time I’m posting here and I tried to look for similar questions but couldn’t find an answer.
I have attached a picture of the column I am working on
Basically in this particular column, I want to count how many bookings are before 12pm and how many are after 12pm for the different dates.
So a function which would return the count of bookings before 12pm and after.
i would really appreciate it if you could help me with this. I’m stuck with this problem for a while.
thanks in advance
15E88275-C2C0-4929-9A73-6FE656234F7C.jpeg
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Let's get the ball rolling. Now if you could just say if this is what you want, that would be a good start. Once people see the input and output, they will be more helpful. I know there are more ways to solve this problem so let's see what happens when the A Students weigh in.


Book1
ABCD
1Date Out
210/27/2020 09:00 AM0.3759Bookings After 12 PM
310/27/2020 04:00 PM0.6675Bookings Before 12 PM
410/27/2020 04:00 PM0.667
510/27/2020 05:00 PM0.708
610/27/2020 08:00 AM0.333
710/28/2020 02:00 PM0.583
810/28/2020 03:00 PM0.625
910/28/2020 08:00 AM0.333
1010/28/2020 04:00 PM0.667
1110/28/2020 06:30 PM0.771
1210/28/2020 08:00 AM0.333
1310/29/2020 02:00 PM0.583
1410/29/2020 09:00 AM0.375
1510/29/2020 02:00 PM0.583
Time
Cell Formulas
RangeFormula
C2C2=COUNTIF(B2:B15,">0.5")
C3C3=COUNTIF(B2:B15,"<0.5")
B2:B15B2=VALUE(RIGHT(TEXT(A2,".000"),4))
 
Upvote 0
@Tonybaga
Welcome to the MrExcel board!

I suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with.
Thanks to @Ezguy4u for doing some of that typing. (y)

I have taken a slightly different interpretation of the requirement based on
count how many bookings are before 12pm and how many are after 12pm for the different dates.

Assuming that you can use your Excel 365 and that it has the UNIQUE function you could try this. Each functon only needs to be entered in the top cell and the other results should automatically 'spill' to the other required rows.

20 10 28.xlsm
ABCDE
1Date OutDateBefore NoonAfter Noon
227/10/2020 09:00 AM27/10/202023
327/10/2020 04:00 PM28/10/202024
427/10/2020 04:00 PM29/10/202012
527/10/2020 05:00 PM
627/10/2020 08:00 AM
728/10/2020 02:00 PM
828/10/2020 03:00 PM
928/10/2020 08:00 AM
1028/10/2020 04:00 PM
1128/10/2020 06:30 PM
1228/10/2020 08:00 AM
1329/10/2020 02:00 PM
1429/10/2020 09:00 AM
1529/10/2020 02:00 PM
16
Count Times
Cell Formulas
RangeFormula
C2:C4C2=UNIQUE(INT(A2:A15))
D2:D4D2=COUNTIFS(A2:A15,">="&C2#,A2:A15,"<"&C2#+0.5)
E2:E4E2=COUNTIFS(A2:A15,">"&C2#+0.5,A2:A15,"<"&C2#+1)
Dynamic array formulas.
 
Upvote 0
Thank you so much guys! that worked like a charm!!
Glad you got a successful outcome. (y)

As a matter of interest, which was the correct interpretation of what you were after?
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,746
Members
449,050
Latest member
excelknuckles

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