View Single Post
  #7   Report Post  
David McRitchie
 
Posts: n/a
Default

Hi Andrew,
You would find formulas like the following on Chip's site and on my site,
I got it from Stephen Bullen (without explanation), glad I recognized
what it was. Arithmetically it is the same as Steve's.
C2: =B2-A2 + (B2<A2)
First you see the regular subtraction, but if B2 is less than A2
it will add 1 from the logical B2<A2 as being True; otherwise, it
adds 0 for false. Dates and times are measured in units of days so
adding 1 is same as adding 24 hours.

Chip's page on Date and Time
http://www.cpearson.com/excel/datetime.htm

My page on Date and Time
http://www.mvps.org/dmcritchie/excel/datetime.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Steve Smallman" wrote in message ...
Start time in column A, end time in column b, calc in column C
23:30 in A2, 02:00 in B2 formula in C2 =if(B2<A2, b2+1-a2, b2-a2) assumes
all tests less than 24 hours