Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Calculate a value between 2 times

we pay a nightshift allowance between 18:00 and 6:00.
I have a timesheet with start and end times.
Say the shift started at 15:00 and ended at 23:00, I need an answer of 5,
or if the shift started at 04:30 and ended at 12:00 I need an answer of 1.5
thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7,247
Default Calculate a value between 2 times

You can use the following formulas. Assume that the start time is in
A1 and the end time is in C1.

To calculate the number of hours between start and 6:00:00, use

=MAX(0,TIME(6,0,0)-A1)*24

To calculate the number of hours between 18:00:00 and end time, use

=MAX(0,C1-TIME(18,0,0)+(C1<TIME(18,0,0)))*24

To calculate the number of hours worked between 6:00:00 and 18:00:00,
excluding hours between 18:00 and 6:00:00, use

=(MIN(C1,TIME(18,0,0))-MAX(A1,TIME(6,0,0))+(C1<A1))*24

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






On Mon, 24 Aug 2009 12:49:13 -0700, Maresa
wrote:

we pay a nightshift allowance between 18:00 and 6:00.
I have a timesheet with start and end times.
Say the shift started at 15:00 and ended at 23:00, I need an answer of 5,
or if the shift started at 04:30 and ended at 12:00 I need an answer of 1.5
thanks

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
Calculate diff. between 2 times Connie Martin Excel Worksheet Functions 3 March 20th 09 05:05 PM
How to calculate the difference between two different times. Highbury 1[_2_] Excel Worksheet Functions 1 February 24th 09 06:27 PM
How Do I Calculate Times KRISSYBOY31 Excel Discussion (Misc queries) 1 January 23rd 07 07:42 PM
Calculate with codes and times elrosso Excel Worksheet Functions 0 April 11th 06 10:09 PM
how to calculate between times noelf Excel Discussion (Misc queries) 1 July 11th 05 11:12 AM


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