It's not the shortest formula I've seen :-) but shall work:
First if tests whether its weekend or working day then for weekend testing if its fists or second half of "the day shifted by 5:30"
similar one is done if first result was working day. First we look if it's first 9 hours of a day "shifted by 6:30", then if it's first 10 hours of day shifted by 17:30 and if this condition is not met we are on working day between 1:30 and 6:30 next day
MOD is used to get rid of negative results of "mooving start of the day from 00:00 by 5:30 or 6:30"
Bookmarks