You need to keep in mind that with a data, if it's stored correctly, that a day is actually a value of 1, and a time is a decimal portion of that, e.g. midday is .5.
Given this, you can work out the time to compare to with a sum:
if(CompletedTime >= (1/24*16),
This assumes that the CompletedTime field only has the time in, and not date time. If it is date time the code becomes:
if((CompletedTime - DayStart(CompletedTime)) >= (1/24*16),
Here you are effectively removing all the days from the time value (i.e. up to midnight at the start of the day) leaving only the decimal portion.
I hope that all makes sense?
I was just about to post a (wrong) solution suggesting that you might be comparing strings rather than numbers due to a non-matching TimeFormat variable, when I found your thread already answered correctly.
Just some thoughts to supplement the solution:
CompletedTime - DayStart(CompletedTime)
might as well be calculated as
which extracts the (fractional) time part from a timestamp value.
should be the same as
since the formatting Date()-function does not change the numerical value of a date/timestamp,
hope this helps