Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default I want to get negative hours if subtraction of hours is negative


A B C
D E
1 In Time Out time Actual hours Working hours
2 9:00 17:00 8:00
8:45 =C2-D2

In the E2 cell i am getting only ####,here i want to get the negative hours



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default I want to get negative hours if subtraction of hours is negative

On Thu, 26 Apr 2007 04:52:02 -0700, hema
wrote:


A B C
D E
1 In Time Out time Actual hours Working hours
2 9:00 17:00 8:00
8:45 =C2-D2

In the E2 cell i am getting only ####,here i want to get the negative hours




You have to either use the 1904 date system; or format the result cell as
something other than date/time, and perform the appropriate math to convert the
value (fraction of a day) into hours and minutes.
--ron
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default I want to get negative hours if subtraction of hours is negative

You could use 1904 date system (tools|Options|calculation tab)

But be aware that any date in that workbook will be off by 4 years and a day.

And exchanging data (including dates) between workbooks with different date
systems can be a pain.

hema wrote:

A B C
D E
1 In Time Out time Actual hours Working hours
2 9:00 17:00 8:00
8:45 =C2-D2

In the E2 cell i am getting only ####,here i want to get the negative hours



--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default I want to get negative hours if subtraction of hours is negative

=(C2*24)-(D2*24)

"hema" wrote:


A B C
D E
1 In Time Out time Actual hours Working hours
2 9:00 17:00 8:00
8:45 =C2-D2

In the E2 cell i am getting only ####,here i want to get the negative hours



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default I want to get negative hours if subtraction of hours is negative

You can't do that but there is a workaround by displaying the negative time
in minutes. Try the formula:-

=(C2-D2)*24*60

"hema" wrote:


A B C
D E
1 In Time Out time Actual hours Working hours
2 9:00 17:00 8:00
8:45 =C2-D2

In the E2 cell i am getting only ####,here i want to get the negative hours





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 72
Default I want to get negative hours if subtraction of hours is negative

Hi Hema,

To check if difference is negative and display as a negative time if negative:
=IF(D2C2,"-"&TEXT(D2-C2,"H:MM"),TEXT(C2-D2,"H:MM"))

To sum a range (rows 2 through 100):
=IF(SUM(D2:D100)SUM(C2:C100),"-"&TEXT(SUM(D2:D100)-SUM(C2:C100),"H:MM"),TEXT(SUM(C2:C100)-SUM(D2:D100),"H:MM"))

"hema" wrote:


A B C
D E
1 In Time Out time Actual hours Working hours
2 9:00 17:00 8:00
8:45 =C2-D2

In the E2 cell i am getting only ####,here i want to get the negative hours



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
calculation with hours and minutes - input of negative values MichaelMichael Excel Discussion (Misc queries) 2 July 10th 06 06:31 PM
how do i show negative time in hours minutes john tyler Excel Worksheet Functions 0 March 6th 06 08:47 PM
Negative Working Hours Mohammed Zenuwah Excel Worksheet Functions 2 July 13th 05 07:39 AM
How to show negative time (e.g. -10 hours) Arhippa Excel Worksheet Functions 3 January 19th 05 08:53 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 09:00 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"