Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22
Default Hours between to two times

I am trying to calculate the hours between 22:00 and 08:00.
The e.g. below shows a worker finishes work at 14:00pm on 1/10/2008 and
starts work at 12:00pm on 2/10/2008 the next day, so their is 10 hours
between 22:00(10Pm) and 08:00(8am). The formula below does not seem to bring
back the correct result.


=IF(M46="","0",MAX($K$40-$M46,0)+MAX($K$39-$O45,0))
Result = 8 should be 10
Cell K39 = 22:00:00
Cell K40 = 8:00:00
Cell O45 = 14:00:00 1/10/2008
Cell M46 = 12:00:00 2/10/2008

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7,247
Default Hours between to two times


Try

=B1-A1+(A1B1)

where A1 is the start time and B1 is the end time. If the end time is
earlier than the start time (e.g. start at 22:00 and end at 8:00), the
expression (A1B1) evaluates to TRUE and TRUE's numeric equivalent 1
is added to the difference. Since the value 1 is the same as 24 hours,
the function adds 1 to the end time which makes it as if the end time
is the following day.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Wed, 15 Oct 2008 15:27:02 -0700, Dave08
wrote:

I am trying to calculate the hours between 22:00 and 08:00.
The e.g. below shows a worker finishes work at 14:00pm on 1/10/2008 and
starts work at 12:00pm on 2/10/2008 the next day, so their is 10 hours
between 22:00(10Pm) and 08:00(8am). The formula below does not seem to bring
back the correct result.


=IF(M46="","0",MAX($K$40-$M46,0)+MAX($K$39-$O45,0))
Result = 8 should be 10
Cell K39 = 22:00:00
Cell K40 = 8:00:00
Cell O45 = 14:00:00 1/10/2008
Cell M46 = 12:00:00 2/10/2008

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22
Default Hours between to two times

This formula is returning the total hours between finish and start times, not
the hours between 10pm and 8am.

"Chip Pearson" wrote:


Try

=B1-A1+(A1B1)

where A1 is the start time and B1 is the end time. If the end time is
earlier than the start time (e.g. start at 22:00 and end at 8:00), the
expression (A1B1) evaluates to TRUE and TRUE's numeric equivalent 1
is added to the difference. Since the value 1 is the same as 24 hours,
the function adds 1 to the end time which makes it as if the end time
is the following day.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Wed, 15 Oct 2008 15:27:02 -0700, Dave08
wrote:

I am trying to calculate the hours between 22:00 and 08:00.
The e.g. below shows a worker finishes work at 14:00pm on 1/10/2008 and
starts work at 12:00pm on 2/10/2008 the next day, so their is 10 hours
between 22:00(10Pm) and 08:00(8am). The formula below does not seem to bring
back the correct result.


=IF(M46="","0",MAX($K$40-$M46,0)+MAX($K$39-$O45,0))
Result = 8 should be 10
Cell K39 = 22:00:00
Cell K40 = 8:00:00
Cell O45 = 14:00:00 1/10/2008
Cell M46 = 12:00:00 2/10/2008


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,805
Default Hours between to two times

This has been cross posted to 'New Users'... Pl. refer to the solution there...
--
Always provide your feedback...


"Dave08" wrote:

This formula is returning the total hours between finish and start times, not
the hours between 10pm and 8am.

"Chip Pearson" wrote:


Try

=B1-A1+(A1B1)

where A1 is the start time and B1 is the end time. If the end time is
earlier than the start time (e.g. start at 22:00 and end at 8:00), the
expression (A1B1) evaluates to TRUE and TRUE's numeric equivalent 1
is added to the difference. Since the value 1 is the same as 24 hours,
the function adds 1 to the end time which makes it as if the end time
is the following day.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Wed, 15 Oct 2008 15:27:02 -0700, Dave08
wrote:

I am trying to calculate the hours between 22:00 and 08:00.
The e.g. below shows a worker finishes work at 14:00pm on 1/10/2008 and
starts work at 12:00pm on 2/10/2008 the next day, so their is 10 hours
between 22:00(10Pm) and 08:00(8am). The formula below does not seem to bring
back the correct result.


=IF(M46="","0",MAX($K$40-$M46,0)+MAX($K$39-$O45,0))
Result = 8 should be 10
Cell K39 = 22:00:00
Cell K40 = 8:00:00
Cell O45 = 14:00:00 1/10/2008
Cell M46 = 12:00:00 2/10/2008


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
Peak call times/hours Ber Excel Worksheet Functions 2 July 14th 08 10:26 AM
Calculation of hourly rate times hours times 1.5 Newbusinessbod Excel Worksheet Functions 1 December 6th 05 04:44 PM
=Text(b2-A2,"h") hours between 2 times, what do I do for 10 times Jayda New Users to Excel 3 May 18th 05 05:53 PM
How do I find the amount of hours between times? gormanj Excel Discussion (Misc queries) 1 May 4th 05 12:26 PM
How do I convert times from hours to minutes? kkrebs Excel Discussion (Misc queries) 5 December 30th 04 06:13 PM


All times are GMT +1. The time now is 04:46 AM.

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"