Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 11-21-2009, 03:13 PM
manickmj1 manickmj1 is offline
Registered User
 
Join Date: 06 Sep 2008
Location: Denver
Posts: 8
manickmj1 is becoming part of the community
Time Sheet Schedule

Please Register to Remove these Ads

I know this is going to be easy for someone, but I am stumped, again.

What I need to do is calculate the hours between two clock times minus 30 minutes.

Example:
Cell A1 - 4:00am
Cell B1 - 16:30
I need Cell C1 to say 12 (hours)

Also:

Cell A2 - 17:30
Cell B2 - 02:00am
I need cell c2 to say 8 (hours)


Thanks for your help.

Last edited by davesexcel; 11-24-2009 at 01:45 AM.
Reply With Quote
  #2  
Old 11-21-2009, 04:16 PM
davesexcel's Avatar
davesexcel davesexcel is offline
Forum Moderator
 
Join Date: 19 Feb 2006
Location: Cochrane,Alberta
MS Office Version:XL 2003
Posts: 4,614
davesexcel is attaining expert status davesexcel is attaining expert status
Re: Time Sheet Schedule

Here is one way
=IF((B1-A1)<0,((B1+12)-A1)-TIME(,30,0),(B1-A1)-TIME(,30,))
__________________
Dave
Please read the Forum Rules before posting!
If I answered your question, click the scale Icon above my location.
Reply With Quote
  #3  
Old 11-22-2009, 10:39 AM
martindwilson's Avatar
martindwilson martindwilson is online now
Forum Guru
 
Join Date: 23 Jun 2007
Location: London,England
MS Office Version:office 97 ,2003 ,2007
Posts: 5,993
martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding
Re: Time Sheet Schedule

with start in a1 finish in b1 eg 18:00 to 01:00
=(B1-A1+(B1<A1))-1/48 gives answer as time eg 06:30 cell formatted time
or as a decimal
=(B1-A1+(B1<A1))*24-0.5 gives 6.5 cell formatted general
__________________
Mojito connoisseur and a dabbler in Cisco
where does code go ?
look here
how to insert code

how to enter array formula


recommended reading
wiki Mojito

how to say no convincingly

most important think you need

Last edited by martindwilson; 11-22-2009 at 10:45 AM.
Reply With Quote
  #4  
Old 11-22-2009, 03:18 PM
manickmj1 manickmj1 is offline
Registered User
 
Join Date: 06 Sep 2008
Location: Denver
Posts: 8
manickmj1 is becoming part of the community
Re: Time Sheet Schedule

the second one worked perfectly Martin, Now 1 more question: Can I add an If formula to it if the answer is less than 1. Reason being if they are off and there arent any times in it it calculates -5 for the 30 min lunch.

Thanks Again!
Reply With Quote
  #5  
Old 11-22-2009, 03:51 PM
martindwilson's Avatar
martindwilson martindwilson is online now
Forum Guru
 
Join Date: 23 Jun 2007
Location: London,England
MS Office Version:office 97 ,2003 ,2007
Posts: 5,993
martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding
Re: Time Sheet Schedule

=if((B1-A1+(B1<A1))*24-0.5<1,0,(B1-A1+(B1<A1))*24-0.5)
__________________
Mojito connoisseur and a dabbler in Cisco
where does code go ?
look here
how to insert code

how to enter array formula


recommended reading
wiki Mojito

how to say no convincingly

most important think you need
Reply With Quote
  #6  
Old 11-22-2009, 10:48 PM
darkyam's Avatar
darkyam darkyam is offline
Forum Guru
 
Join Date: 05 Mar 2008
Location: Virginia, US
MS Office Version:2007
Posts: 1,645
darkyam is very confident of their ability darkyam is very confident of their ability darkyam is very confident of their ability darkyam is very confident of their ability
Re: Time Sheet Schedule

If you just want to avoid negative numbers, =MAX(MOD(B1-A1-1/48,1),0)*24 is a little shorter and should do the same thing.
Reply With Quote
  #7  
Old 11-23-2009, 11:51 PM
manickmj1 manickmj1 is offline
Registered User
 
Join Date: 06 Sep 2008
Location: Denver
Posts: 8
manickmj1 is becoming part of the community
Re: Time Sheet Schedule

thank you all! How do I enter this as solved?
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump