Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default time subtraction problem

I have two times,
22:19 pm and 1:50 am
obviously 1:50 is after 22:19 but when I try to subtract it -- 22:19 - 1:50
excel gives me gibberish.

thnks.

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

=MOD(B1-A1,1)

--
HTH

Bob Phillips

<a wrote in message ...
I have two times,
22:19 pm and 1:50 am
obviously 1:50 is after 22:19 but when I try to subtract it -- 22:19 -

1:50
excel gives me gibberish.

thnks.



  #3   Report Post  
Govind
 
Posts: n/a
Default

Hi,

Lets say your start time is in cell A1 and end time is in B1, use the
formula

=IF(B1<A1,B1+1-A1,B1-A1)

and format the cell in the time format you wish.

Regards

Govind.

a wrote:
I have two times,
22:19 pm and 1:50 am
obviously 1:50 is after 22:19 but when I try to subtract it -- 22:19 -
1:50
excel gives me gibberish.

thnks.

  #4   Report Post  
 
Posts: n/a
Default

thanks.

both formulae worked,
but I would prefer the IF statement even though its abit longer.
since it applies to both cases of A1 B1 or B1 A1, i can drag the formula
down the whole column.

BTW, what does (time + 1) do to the smaller time?

thnks.

  #5   Report Post  
Govind
 
Posts: n/a
Default

Hi,

Thanks for the feedback. The +1 adds one day to the smaller time.

Govind.

a wrote:
thanks.

both formulae worked,
but I would prefer the IF statement even though its abit longer.
since it applies to both cases of A1 B1 or B1 A1, i can drag the
formula down the whole column.

BTW, what does (time + 1) do to the smaller time?

thnks.



  #6   Report Post  
Roger Govier
 
Posts: n/a
Default

You can also copy Bob's formula down the column. It will work with both
cases.

--
Regards
Roger Govier
<a wrote in message ...
thanks.

both formulae worked,
but I would prefer the IF statement even though its abit longer.
since it applies to both cases of A1 B1 or B1 A1, i can drag the
formula down the whole column.

BTW, what does (time + 1) do to the smaller time?

thnks.



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


<a wrote in message ...

both formulae worked,
but I would prefer the IF statement even though its abit longer.
since it applies to both cases of A1 B1 or B1 A1, i can drag the

formula
down the whole column.


and mine doesn't?


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
LOCK TIME confused Excel Discussion (Misc queries) 4 May 23rd 05 08:34 PM
Time Sheets Lady Layla Excel Discussion (Misc queries) 1 March 23rd 05 03:22 PM
subtraction with time format cells Stefano Excel Worksheet Functions 2 March 17th 05 03:06 PM
Help - Information with time and date PM Excel Discussion (Misc queries) 4 January 6th 05 08:25 AM
Problem with time calc Tom Excel Worksheet Functions 2 November 6th 04 12:04 PM


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