Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default subtract hours, not time of day

I would like to subtract hours, not time of day and have it end up in h:mm
format. currently I am subtracting a cell with hours in h:mm format from a
cell in number (0 decimal places) format with the following formula:

=((HOUR(E18)*60)+MINUTE(E18)-($I$8*60))/60

As an example the cell E18 is 30 and cell I8 is 6:45 and my answer is
-23.75. Can I get this cell to format to -23:45 ? I am calculating Comp time
on a timesheet, so the number can be positive or negative.

Thanks,
Steve
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default subtract hours, not time of day

=IF(E18I8,"-","")&TEXT(ABS(I8-E18/24),"[h]:mm")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steve@Blackhawk" wrote in
message ...
I would like to subtract hours, not time of day and have it end up in h:mm
format. currently I am subtracting a cell with hours in h:mm format from a
cell in number (0 decimal places) format with the following formula:

=((HOUR(E18)*60)+MINUTE(E18)-($I$8*60))/60

As an example the cell E18 is 30 and cell I8 is 6:45 and my answer is
-23.75. Can I get this cell to format to -23:45 ? I am calculating Comp

time
on a timesheet, so the number can be positive or negative.

Thanks,
Steve



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
Subtract 12 hours from date/time Cindy Excel Discussion (Misc queries) 8 April 26th 23 07:46 PM
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
using if statement to subtract 24 hours from time richard.littlewing Excel Worksheet Functions 2 September 15th 08 12:15 AM
Subtract hours from a time and get the correct time casey Excel Worksheet Functions 1 June 22nd 08 08:41 PM
Time/Date subtract 24 hours ET902 Excel Discussion (Misc queries) 4 September 12th 06 02:47 PM


All times are GMT +1. The time now is 09:15 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"