Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default NEGATIVE HOURS

Would like to cumulate work time in a schedule. I have to compare worked
time to a maximun dayly working time of 7:00 hours. so if I worked 5 hours
out of 7 I would like to obtain minus 2 hours (-2:00) I tried a1-a2 format
to day and time... No succes

Any ideas ???

André Lavoie


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default NEGATIVE HOURS

If you use the 1904 date system in excel, you can use negative time
(tools=options=calculate tab).

However, this will probably make all your dates off by 4 years.

If you want to use decimal number of hours you can

=(a1-a2)*24

--
Regards,
Tom Ogilvy

"André Lavoie" wrote in message
.. .
Would like to cumulate work time in a schedule. I have to compare worked
time to a maximun dayly working time of 7:00 hours. so if I worked 5 hours
out of 7 I would like to obtain minus 2 hours (-2:00) I tried a1-a2

format
to day and time... No succes

Any ideas ???

André Lavoie




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default NEGATIVE HOURS

It also has the potential to cause confusion, since 1/24 and -1/24 are
both displayed as 1:00:00 AM (i.e. there is no formatted indication that
the time is negative).

Jerry

Tom Ogilvy wrote:

If you use the 1904 date system in excel, you can use negative time
(tools=options=calculate tab).

However, this will probably make all your dates off by 4 years.

If you want to use decimal number of hours you can

=(a1-a2)*24


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default NEGATIVE HOURS

In MacXL, -1/24 displays as -1:00:00 AM.

Is this a bug in WinXL?


In article ,
"Jerry W. Lewis" wrote:

It also has the potential to cause confusion, since 1/24 and -1/24 are
both displayed as 1:00:00 AM (i.e. there is no formatted indication that
the time is negative).

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default NEGATIVE HOURS

In Excel XP, the first time format is listed as "*1:30:55 PM" in the
Time category and "[$-409]h:mm AM/PM;@" in the Custom category. It does
not show the sign for negative times in the 1904 date system. All other
time formats do show the sign (I never use the 1904 system in practice,
and got snookered by it being the first one, sorry). Interestingly,
that custom format in Excel 2000 does display the sign on negative
times. I don't have access to Excel 2003 tonight to see what it does.

Jerry

JE McGimpsey wrote:

In MacXL, -1/24 displays as -1:00:00 AM.

Is this a bug in WinXL?


In article ,
"Jerry W. Lewis" wrote:


It also has the potential to cause confusion, since 1/24 and -1/24 are
both displayed as 1:00:00 AM (i.e. there is no formatted indication that
the time is negative).




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default NEGATIVE HOURS

In XL03, the *13:30:55 format also shows 1:00:00 for -1/24.

The format note indicates that that format "switch(es) date or time
orders with the operating system", whatever that means.

Frankly, if that's not a bug, it's at least a terrible design decision.


In article ,
"Jerry W. Lewis" wrote:

In Excel XP, the first time format is listed as "*1:30:55 PM" in the
Time category and "[$-409]h:mm AM/PM;@" in the Custom category. It does
not show the sign for negative times in the 1904 date system. All other
time formats do show the sign (I never use the 1904 system in practice,
and got snookered by it being the first one, sorry). Interestingly,
that custom format in Excel 2000 does display the sign on negative
times. I don't have access to Excel 2003 tonight to see what it does.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default NEGATIVE HOURS

Excel 97 SR2 on Win 98 SE displayed the negative sign as you show the MAC
doing.

--
Regards,
Tom Ogilvy

"JE McGimpsey" wrote in message
...
In MacXL, -1/24 displays as -1:00:00 AM.

Is this a bug in WinXL?


In article ,
"Jerry W. Lewis" wrote:

It also has the potential to cause confusion, since 1/24 and -1/24 are
both displayed as 1:00:00 AM (i.e. there is no formatted indication that
the time is negative).



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default NEGATIVE HOURS

While we are on the subject of design decisions, does MacXL date display
-1 as -1/2/1904 in the 1904 date system?

Jerry

JE McGimpsey wrote:

In XL03, the *13:30:55 format also shows 1:00:00 for -1/24.

The format note indicates that that format "switch(es) date or time
orders with the operating system", whatever that means.

Frankly, if that's not a bug, it's at least a terrible design decision.


In article ,
"Jerry W. Lewis" wrote:


In Excel XP, the first time format is listed as "*1:30:55 PM" in the
Time category and "[$-409]h:mm AM/PM;@" in the Custom category. It does
not show the sign for negative times in the 1904 date system. All other
time formats do show the sign (I never use the 1904 system in practice,
and got snookered by it being the first one, sorry). Interestingly,
that custom format in Excel 2000 does display the sign on negative
times. I don't have access to Excel 2003 tonight to see what it does.


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default NEGATIVE HOURS

Yup. Definitely a bad design decision, IMO. There are certainly
legitimate uses for "negative hours". I can't think of a single use for
negative dates.

In my production apps, I often redefine the Date Style to something like

mm/dd/yy;-0;0;@

In article ,
"Jerry W. Lewis" wrote:

While we are on the subject of design decisions, does MacXL date display
-1 as -1/2/1904 in the 1904 date system?

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
using if statement to subtract 24 hours from time still shows as a negative time from both responses under 24 hours richard.littlewing Excel Worksheet Functions 2 September 15th 08 08:05 AM
Negative hours [h]:mm:ss The Rook[_2_] Excel Discussion (Misc queries) 5 July 3rd 08 05:36 PM
I want to get negative hours if subtraction of hours is negative hema Excel Worksheet Functions 5 April 30th 07 10:02 AM
Negative Working Hours Mohammed Zenuwah Excel Worksheet Functions 2 July 13th 05 07:39 AM
How can I show hours of more than 24 & negative hours? Peterlg Excel Worksheet Functions 1 January 18th 05 04:50 PM


All times are GMT +1. The time now is 01:46 PM.

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

About Us

"It's about Microsoft Excel"