Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Getting no of hours from start to finish

Hello

I'm working on a time sheet.

I can get the day shift calculations working OK but I'm having trouble
with the night shift.

The formula I'm using is:

=IF(I19="Day";IF(SUM(K20:K21)0;SUM(K21-K20)-TIME(0;30;0));IF(SUM(K20:K21)0;SUM(K20-K21)-TIME(0;30;0)))

The night shift part is in the second half of the formula ie:

......IF(SUM(K20:K21)0;SUM(K20-K21)-TIME(0;30;0)))

Times are in 24 hour format. "-TIME(0;30;0)" is to allow for a 30
minute lunch break

K20 holds the start time and K21 holds the finish time

The problem is when I choose 17:00 for the start time and 06:00 for the
finish time I get 10:30 hours worked iinsted of 12:30 hours worked. I
get the feeling it's subtracting 6AM from 5PM to tell me it's 10:30AM

How can I fix this so I get the number of hours from 17:00 (5PM) to
06:00 (6AM).

Thanks

Peter Mount

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default Getting no of hours from start to finish

Hi Peter

Try
=MOD(K21-K20,1)-TIME(0,30,0)

--
Regards

Roger Govier


"Peter Mount" wrote in message
ps.com...
Hello

I'm working on a time sheet.

I can get the day shift calculations working OK but I'm having trouble
with the night shift.

The formula I'm using is:

=IF(I19="Day";IF(SUM(K20:K21)0;SUM(K21-K20)-TIME(0;30;0));IF(SUM(K20:K21)0;SUM(K20-K21)-TIME(0;30;0)))

The night shift part is in the second half of the formula ie:

.....IF(SUM(K20:K21)0;SUM(K20-K21)-TIME(0;30;0)))

Times are in 24 hour format. "-TIME(0;30;0)" is to allow for a 30
minute lunch break

K20 holds the start time and K21 holds the finish time

The problem is when I choose 17:00 for the start time and 06:00 for
the
finish time I get 10:30 hours worked iinsted of 12:30 hours worked. I
get the feeling it's subtracting 6AM from 5PM to tell me it's 10:30AM

How can I fix this so I get the number of hours from 17:00 (5PM) to
06:00 (6AM).

Thanks

Peter Mount



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Getting no of hours from start to finish

Hi Roger

I modified your suggestion to be:

=IF(SUM(K20:K21)0;MOD(K21-K20;1)-TIME(0;30;0);"")

That way if no times are entered for that day the total cell is blank
instead of ########, which I found to have an affect on the total for
the week at the end of the row of days.

Thanks very much for your help

Have fun

Peter Mount

Roger Govier wrote:
Hi Peter

Try
=MOD(K21-K20,1)-TIME(0,30,0)

--
Regards

Roger Govier


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,886
Default Getting no of hours from start to finish

Hi Peter

I had not meant that formula was complete, merely that you should
replace that part of your formula.
Glad you got it sorted out.

--
Regards

Roger Govier


"Peter Mount" wrote in message
ups.com...
Hi Roger

I modified your suggestion to be:

=IF(SUM(K20:K21)0;MOD(K21-K20;1)-TIME(0;30;0);"")

That way if no times are entered for that day the total cell is blank
instead of ########, which I found to have an affect on the total for
the week at the end of the row of days.

Thanks very much for your help

Have fun

Peter Mount

Roger Govier wrote:
Hi Peter

Try
=MOD(K21-K20,1)-TIME(0,30,0)

--
Regards

Roger Govier




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
how to calculate time start & time finish in quarter hour Peter Wu Excel Discussion (Misc queries) 3 June 7th 06 12:58 AM
Help with Sum if (or something else not sure) Lost in reconcillation Excel Worksheet Functions 5 June 6th 06 08:57 PM
formula to lookup & sum totals, given a start inv.# & finish inv.# Learning the hard way Excel Worksheet Functions 2 May 21st 06 12:53 PM
Excel Timesheet Matt Excel Discussion (Misc queries) 8 September 7th 05 09:53 PM
what should i use darryll Excel Worksheet Functions 3 March 6th 05 05:26 AM


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