Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
kvani
 
Posts: n/a
Default Time Difference


Hi,
I want to find the time difference between column1 & 2
I have indicated in the last column what I should be getting. Pls
assist.
Thank you and Rgds. :)

column1 column2 column1-column2 should be
23:45 00:15 23:30 minus 30mins
09:15 09:30 -00:15 correct
07:30 07:15 00:15 correct
00:15 23:45 -23:30 30mins


--
kvani
------------------------------------------------------------------------
kvani's Profile: http://www.excelforum.com/member.php...o&userid=27725
View this thread: http://www.excelforum.com/showthread...hreadid=472379

  #2   Report Post  
Peter Horrocks
 
Posts: n/a
Default

Your examples show the correct results. The difference between 00:15 and
23:45 on the same day is 23:30. If you want to cross date boundaries, you
can't expect Excel to assume you mean the following day. As to the solution,
I don't know myself but I have seen something about this elsewhere. If I can
find it I will post it.

Peter


"kvani" wrote in
message ...

Hi,
I want to find the time difference between column1 & 2
I have indicated in the last column what I should be getting. Pls
assist.
Thank you and Rgds. :)

column1 column2 column1-column2 should be
23:45 00:15 23:30 minus 30mins
09:15 09:30 -00:15 correct
07:30 07:15 00:15 correct
00:15 23:45 -23:30 30mins


--
kvani
------------------------------------------------------------------------
kvani's Profile:

http://www.excelforum.com/member.php...o&userid=27725
View this thread: http://www.excelforum.com/showthread...hreadid=472379



  #3   Report Post  
Sandy Mann
 
Posts: n/a
Default

Try:

=B1-A1+(A1B1)

or

=MOD(B1-A1,1)

Time in XL is fraction of a day so a whole day id equal to 1.
If the +(A1B1) in the first formula is TRUE then XL converts it to 1 in the
addition so the formula is =B1-A1+1 which takes care of the fact that B1 is
smaller. If the time does not cross midnight then +(A1B1) will evaluate to
False which XL will change to 0 so it will not alter anything.

The second formula is not so eay to see and works because the MOD function
always retuns a positive even if the argument is negative.

--
HTH

Sandy

Replace@mailinator with @tiscali.co.uk


"kvani" wrote in
message ...

Hi,
I want to find the time difference between column1 & 2
I have indicated in the last column what I should be getting. Pls
assist.
Thank you and Rgds. :)

column1 column2 column1-column2 should be
23:45 00:15 23:30 minus 30mins
09:15 09:30 -00:15 correct
07:30 07:15 00:15 correct
00:15 23:45 -23:30 30mins


--
kvani
------------------------------------------------------------------------
kvani's Profile:
http://www.excelforum.com/member.php...o&userid=27725
View this thread: http://www.excelforum.com/showthread...hreadid=472379




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
Calculating time difference over midnight! sygazelle Excel Discussion (Misc queries) 4 September 29th 05 04:59 PM
Calculate difference in time spanning a day, during office hours o frozenfusion Excel Discussion (Misc queries) 1 August 26th 05 10:39 AM
Converting from time format to decimal and figuring the difference Steve Williams Excel Discussion (Misc queries) 1 July 30th 05 10:10 PM
Time zone Time difference mac_see Excel Worksheet Functions 0 May 3rd 05 07:57 PM
calculate negative or positve difference in time kpmoore Excel Discussion (Misc queries) 2 January 5th 05 01:35 AM


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