True, Sandy....I failed to mention that the formula I posted is an ARRA
FORMULA*.
Your previously posted formula always calculates 24 hours when bot
cells are blank.
I believe this formula satisfies the OP's requirements:
=IF(AND(ISBLANK(C2),MAX((C$2:C2>0)*ROW(C$2:C2))>=MAX((B$2:B2>0)*ROW(B$2:B2))),0,IF(C2="",24,C2*24)-IF(B2="",0,B2*24))
That array formula only calculates times for the trip duration
ignoring blank cells where no trip is in progress.
(thanks for spotting the mispost)
Regards,
Ron
*Note: For array formulas, hold down [Ctrl] and [Shift] when you pres
[Enter], instead of just pressing [Enter]
--
Ron Coderr
-----------------------------------------------------------------------
Ron Coderre's Profile:
http://www.excelforum.com/member.php...fo&userid=2141
View this thread:
http://www.excelforum.com/showthread.php?threadid=54805