#1   Report Post  
Erika
 
Posts: n/a
Default Subtract Hours

I have a list of times and I need to subtract 5 hours from each time. Some
are AM and some are PM. What is the best function to use?
  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

One way:

=A1-TIME(5,0,0)

Alternatively, since times in XL are stored as fractional days, you
could use

=A1 - 5/24

which is just a bit more efficient than using the TIME() function.

In article ,
"Erika" wrote:

I have a list of times and I need to subtract 5 hours from each time. Some
are AM and some are PM. What is the best function to use?

  #3   Report Post  
Erika
 
Posts: n/a
Default

I tried the first example you gave =A1-TIME(5,0,0) - however my result is
########## that no matter how wide I make the column it keeps doing that. I
got the same result with your second suggestion. Do I need to select a
different time format?

"JE McGimpsey" wrote:

One way:

=A1-TIME(5,0,0)

Alternatively, since times in XL are stored as fractional days, you
could use

=A1 - 5/24

which is just a bit more efficient than using the TIME() function.

In article ,
"Erika" wrote:

I have a list of times and I need to subtract 5 hours from each time. Some
are AM and some are PM. What is the best function to use?


  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

That is because A1 probably starts at less than 5 hours, and Excel doesn't
like negative time.

What would you like to happen if A1 is less than 5am to start with?

--
HTH

Bob Phillips

"Erika" wrote in message
...
I tried the first example you gave =A1-TIME(5,0,0) - however my result

is
########## that no matter how wide I make the column it keeps doing that.

I
got the same result with your second suggestion. Do I need to select a
different time format?

"JE McGimpsey" wrote:

One way:

=A1-TIME(5,0,0)

Alternatively, since times in XL are stored as fractional days, you
could use

=A1 - 5/24

which is just a bit more efficient than using the TIME() function.

In article ,
"Erika" wrote:

I have a list of times and I need to subtract 5 hours from each time.

Some
are AM and some are PM. What is the best function to use?




  #5   Report Post  
JE McGimpsey
 
Posts: n/a
Default

Sorry - If you're using the WinXL default 1900 date system, that
indicates that the result is negative, and that date system can't
display negative times.

Instead, use

=MOD(A1-TIME(5,0,0),1)



In article ,
"Erika" wrote:

I tried the first example you gave =A1-TIME(5,0,0) - however my result is
########## that no matter how wide I make the column it keeps doing that. I
got the same result with your second suggestion. Do I need to select a
different time format?



  #6   Report Post  
Erika
 
Posts: n/a
Default

Bingo! That worked great - thank you for your help.

"JE McGimpsey" wrote:

Sorry - If you're using the WinXL default 1900 date system, that
indicates that the result is negative, and that date system can't
display negative times.

Instead, use

=MOD(A1-TIME(5,0,0),1)



In article ,
"Erika" wrote:

I tried the first example you gave =A1-TIME(5,0,0) - however my result is
########## that no matter how wide I make the column it keeps doing that. I
got the same result with your second suggestion. Do I need to select a
different time format?


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
excel [HHHHH]:mm add subtract hours mins inc lnegative mexico Excel Worksheet Functions 0 July 5th 05 05:45 PM
calculating hours bus2408 Excel Worksheet Functions 2 June 23rd 05 02:39 PM
calculate hours just can't figure it out monish74 Excel Worksheet Functions 1 February 13th 05 07:31 PM
calculate difference in time to hours Chris Excel Worksheet Functions 5 January 18th 05 06:07 PM
Subtracting paid hours from unpaid hours ejerry7 Excel Worksheet Functions 5 November 29th 04 04:16 AM


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