Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default time clock wrap around midnight

Hi

For example I have two times entered as 23:30 and 1:45 (but the next day) we
are not entering the date just the time. Subtracting the two gets the
correct answer but when the times wrap around midnight (as above) then there
is a negative time difference and it is wrong.

How can I keep entering just the basic time (without date) and take the
difference and make this difference work around midnight?

thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default time clock wrap around midnight

With start time in A1 and end time in B1


=B1-A1+(B1<A1)

or

=MOD(B1-A1,2)

don't forget to format result as time

--
Regards,

Peo Sjoblom



"BillO" wrote in message
...
Hi

For example I have two times entered as 23:30 and 1:45 (but the next day)
we
are not entering the date just the time. Subtracting the two gets the
correct answer but when the times wrap around midnight (as above) then
there
is a negative time difference and it is wrong.

How can I keep entering just the basic time (without date) and take the
difference and make this difference work around midnight?

thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default time clock wrap around midnight

One way:

=MOD(B1-A1,1)

formatting as time.

Alternatively,

=B1-A1+(A1<B1)

In article ,
BillO wrote:

Hi

For example I have two times entered as 23:30 and 1:45 (but the next day) we
are not entering the date just the time. Subtracting the two gets the
correct answer but when the times wrap around midnight (as above) then there
is a negative time difference and it is wrong.

How can I keep entering just the basic time (without date) and take the
difference and make this difference work around midnight?

thanks

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default time clock wrap around midnight

Oops, switch that

=B1-A1+(B1<A1)

In article ,
JE McGimpsey wrote:

=B1-A1+(A1<B1)

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change EXCEL Clock to Standard Clock or Military Time YoMarie Excel Worksheet Functions 4 April 29th 07 08:39 PM
Calculating time past midnight. mailrail Excel Discussion (Misc queries) 3 April 18th 07 07:39 PM
subtraction off time after midnight Steved Excel Worksheet Functions 2 May 24th 06 01:46 AM
Calculating Time Past Midnight Darren Excel Worksheet Functions 6 March 13th 06 03:03 PM
Calculating time interval (some across midnight) [email protected] Excel Worksheet Functions 3 January 17th 06 05:50 PM


All times are GMT +1. The time now is 07:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"