Countif a datetime group is greater than a particular time, regardless of date

admvlad

New Member
Joined
Apr 29, 2024
Messages
7
Office Version
  1. 2021
Platform
  1. Windows
I am trying to track the start time of certain events. So I need to know if a time is after 4pm, however the format is a a date time group. How can I get a count of any start time after 4pm regardless of what the date is? The cell is formatted like this :
4/28/2024 10:52:00 AM
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
assume your date is in cell B2:

Formula in C2:
Excel Formula:
=Mod(B2,1)>16/24

will give yoiu true or false for any date with time greater than 4pm (not including 4 pm)
Cell Formulas
RangeFormula
C2:C17C2=MOD(B2,1)>16/24
D2D2=SUM(--(MOD($B$2:$B$17,1)>16/24))
B3:B17B3=B2+1+1/24
 
Last edited:
Upvote 0
Solution
assume your date is in cell B2:

Formula in C2:
Excel Formula:
=Mod(B2,1)>16/24

will give yoiu true or false for any date with time greater than 4pm (not including 4 pm)
Cell Formulas
RangeFormula
C2:C17C2=MOD(B2,1)>16/24
D2D2=SUM(--(MOD($B$2:$B$17,1)>16/24))
B3:B17B3=B2+1+1/24

Thank you awoohaw. That works perfectly!
 
Upvote 0

Forum statistics

Threads
1,223,954
Messages
6,175,601
Members
452,658
Latest member
GStorm

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