Times and dates in Excel are just formatted numbers. Dates to the left
of the decimal and times to the right.
With 10:22 AM in A1 and 4:45 PM in B1, the formula in C1 would be:
=B1-A1
Excel will automatically format the result as AM/PM time - just change
the format to something that doesn't have AM/PM included like h:mm;@.
To demonstrate the simplicity, format all the cells as general -
4:45 PM = 0.697916667
minus
10:22 AM = 0.431944444
equals
6:23 = 0.265972222
Excel won't display negative time values - you'll get a cell full of
#######.
Other than that, there's nothing special about the math, it's all in
the formatting with times and dates.
Cliff Edwards
|