You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
I am looking for a formula that will do the fallowing.
Look at cell E2 and E3 if there is a value in both cells then calculate the time and display it in cell G2. If there is only one value then calculate the time difference between cell E2 and F3 and display the result in cell G3.
A B C D E F G
1 DATE N# DAYS OFF ON DUTY OFF DUTY TOTAL DUTY
2 20:00
3 5:00 9
4 15:00 20:00 5
5
6
7
8
9