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.
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
Last edited by martindwilson; 11-22-2009 at 10:45 AM.
Mojito connoisseur and a dabbler in Cisco
where does code go ?
look here
how to insert code
how to enter array formula
why use -- in sumproduct
recommended reading
wiki Mojito
how to say no convincingly
most important thing you need
Martin Wilson: SPV
and RSMBC
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!
=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
why use -- in sumproduct
recommended reading
wiki Mojito
how to say no convincingly
most important thing you need
Martin Wilson: SPV
and RSMBC
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.
thank you all! How do I enter this as solved?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks