How to check if a time is within a start and end time

Example Ask: I have a [Date] column with values like 2022-09-04 12:30:40 and want to find if the timestamp for that day is between 9:01am and 5:29pm.

Solution: Convert the time to minutes and check if the time in minutes is between the start and end time in minutes.

The formula for minutes is: Minute([Date]) + (Hour([Date]) * 60

  • 9:01am in minutes is 9*60 + 1
  • 5:29pm in minutes is 17*60 + 29

The final formula is:

Between(Minute([Date]) + (Hour([Date]) * 60), 9*60 + 1, 17*60 + 29)

Thanks @erin, interesting topic!
I used this formula (below with your example data) which can easily be extended to include seconds as well:

Between(DateFormat([Date], "%H:%M"), "09:01", "17:29")

Basically I only keep the time of [Date] and then compare it with the start and end time

Hope it can be useful :slight_smile:

Added Formulas