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

How do I convert time of day to time according to midnight? Ex. 21:37 to
-2,23? Or 02:43 to +2,43? Midnight is defined as 0.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default time around midnight

With time in A1 ...for 21:47 ...

=(HOUR(1-A1)+MINUTE(1-A1)*0.01)*-1

For 02:43 ...

=HOUR(B1)+MINUTE(B1)*0.01

With I assume some test (IF condition) if time is before or after MIDDAY?


"Mai-Britt" wrote:

How do I convert time of day to time according to midnight? Ex. 21:37 to
-2,23? Or 02:43 to +2,43? Midnight is defined as 0.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default time around midnight

If I am reading what you want correctly, try
=if(mod(time_entry,1)<0.5,hour(time_entry)+minute( time_entry)/100,-hour(1-mod(time_entry,1))-minute(1-mod(time_entry,1))/100

"Mai-Britt" wrote:

How do I convert time of day to time according to midnight? Ex. 21:37 to
-2,23? Or 02:43 to +2,43? Midnight is defined as 0.

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
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
Calculating time difference over midnight! sygazelle Excel Discussion (Misc queries) 4 September 29th 05 04:59 PM


All times are GMT +1. The time now is 12:26 AM.

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"