The trick here, is to design a function which returns the number of valid hours from a specific point in time. A point that you know will make calculation easiest. I suggest midnight on a Monday morning near the basepoint of the date system in VBA 31/12/1899). As the way Date/Time values are stored is numerically as a count of days, this should be relatively straightforward. Work out how many weeks from this point, which accrues that many times the weekly value, then calculate the number of days (with a max of 5), then the valid hours into the day. This function should then return a value of the number of hours from that starting basepoint.
If you pass both of the date/times into this function then you simply need to subtract one resultant value from the other.
Does this all make sense?
