Hi Leo!
It's all to do with covering the case where an end time is after
midnight and where we have input only times without a date element.
You can see this better if you format both the start time and end time
as dd-mmm-yyyy hh:mm:ss. In the "abnormal" case of the end time being
earlier than the start time, you'll see they both are on the same day
(01-Jan-1900) whereas, because we have gone over midnight, we should
add 1 day to the end time to make it 02-Jan-1900.
When the start time is less than the end time hours it means that the
end time is in the next day.
To meet this we add 1 in those cases.
=(B1<A1)
returns TRUE if the end time is less than the start time and FALSE
otherwise. In a calculation, the TRUE is coerced to 1 and FALSE to
zero.
If you incorporate dates in the entries of start time and end time the
adjustment isn't necessary.
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.