Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Default Difference in Time hour what formula to use in excel?

Hi

Cell A1 & Cell B1 is having time format of 24hrs, h:mm,

I have put the data in A1 as 23.30 pm & in B1 1.30 am, difference between these two time is 2 hrs, .I have tried all the formula hour, time etc but didn't get the correct value.

Please suggest me the right formula to use here.

Thank you
Sunita
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Difference in Time hour what formula to use in excel?

Hi Sunita,

Am Fri, 19 Oct 2012 10:55:41 +0000 schrieb Sunita23:

Cell A1 & Cell B1 is having time format of 24hrs, h:mm,

I have put the data in A1 as 23.30 pm & in B1 1.30 am, difference
between these two time is 2 hrs, .I have tried all the formula hour,
time etc but didn't get the correct value.


try:
=MOD(B1-A1,1)


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Difference in Time hour what formula to use in excel?

Hi Sunita,

Am Fri, 19 Oct 2012 15:48:48 +0200 schrieb Claus Busch:

=MOD(B1-A1,1)


if you want an integer instead of time then:
=24*MOD(B1-A1,1)
and format the cell with the result as "General"


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #4   Report Post  
Member
 
Posts: 93
Default

Hi

Or just add 1: =(1+B1)-A1
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Difference in Time hour what formula to use in excel?

Hi Kevin,

Am Sat, 20 Oct 2012 06:35:46 +0000 schrieb
:

Or just add 1: =(1+B1)-A1


the MOD formula works with dayshift *and* with nightshift.
With dayshift your formula has 24 hours to many. It *shows* the real
result but if you format the cell [h]:mm you will see it.


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2


  #6   Report Post  
Member
 
Posts: 93
Default

Yes mate, I am well aware of that! As you well know there are many ways to skin a cat. So for the OP I was pointing out another option!
Another version, bit longer then the MOD: =IF(B1<A1,1+B1,B1)-A1

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
Formula to convert range of time into 1 hour increment Todd Excel Discussion (Misc queries) 5 November 6th 08 07:29 PM
Time formula (difference of predicted and actual time) deb Excel Discussion (Misc queries) 7 September 26th 08 04:55 PM
changing time formula from 16 hour days to 24 Scott W Excel Programming 11 July 12th 07 05:58 PM
How can I use a time difference in a subsequent formula in Excel? numberman37 Excel Worksheet Functions 10 July 26th 05 07:42 PM
Calculate time difference to the half hour Ken Ivins Excel Worksheet Functions 6 July 17th 05 05:48 PM


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