> This is what I put in "H13" (because my two cells are G13 and F13. This
> keeps the tally cell blank, unless both time cells have data. It could
> be modified to use the integer version quite easily, IIRC. The times
> were entered in 24 Hr format and no date info.
>
> =IF(IF((OR(G13="",F13="")),0,IF((G13<F13),((G13-F13)*24)+24,(G13-F13)*24))=0,"",IF((OR(G13="",F13="")),0,IF((G13<F13),((G13-F13)*24)+24,(G13-F13)*24)))
I use something similar, just shorter...
What I posted was a (modified to calc minutes) version of something I
use to track time worked on projects. Here's what I use for calcing
elapsed time in hours (formatted as "#.00"), based on Start/Stop times
not being empty. (All 1 line...)
=IF(AND(Start<>"",Stop<>"",Stop>Start),(Stop-Start)*24,
IF(AND(Start<>"",Stop<>"",Stop<Start),((Stop+1)-Start)*24,
""))
Also, no date info and times are entered in AM/PM format.
(Actually, this is the result of Ctrl+; being used to record time
on the fly for work done on projects)
Start (ColAbsolute-RowRelative) is entered in ColF;
Stop (ColAbsolute-RowRelative) is entered in ColG;
ElapsedTime is calced in ColH using the above formula.
Cols I/J calc month totals (date required for each entry) and
sub-project totals. (sheet supports sub-projects under a main project)
Project billing total is calced elsewhere on the sheet based on rate
for services provided.
--
Garry
Free usenet access at
http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc