View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Corey
 
Posts: n/a
Default Calculation of Hrs and Mins from 2 Time Frames

I get a formula error with what you posted when i try to input it into a
cell

"Marcelo" wrote in message
...
Hi Corey,

I solved it as follow,

On A1 put 07:30
On B1 put 15:30
on C2 put 18:30

imagine that you have on A6 29/5/2006 07:30 and on B6 29/5/2006 20:00

Formula on C6 (normal hours)
=if(or(weekday(a6)=1,weekday(a6)=7),if(and(time(ho ur(a6),minute(a6),0)=a1,time(hour(b6),minute(b6),0 )-time(hour(a6),minute(a6),0)(b1-a1),(b1-a1),time(hour(b6),minute(b6),0)-time(hour(a6),minute(a6),0)))

Formula on D6 (T&H hours)
=if(weekday(a6)=1,0,if(time(hour(b6),minute(b6),0)-time(hour(a6),minute(a6),0)-c6(c1-b1),(c1-b1)time(hour(b6),minute(b6),0)-time(hour(a6),minute(a6),0)-c6))

Formula on E6 (double)
=if(time(hour(b6),minute(b6),0)-time(hour(a6),minute(a6),0)soma(c6:d6),time(hour( b6),minute(b6),0)-time(hour(a6),minute(a6),0)-soma(c6:d6),0)

hope its helps
Regards from Brazil
Marcelo











"Corey" escreveu:

Example:
Normal Hours= 7:30am - 3:30pm MON-FRI.
Time & Half Hours= 3:30pm-6:30pm MON-FRI and First 3hours on a SAT.
Double Time= All other hours remaining.

Senario:
A1=29/5/2006 7:30am
B1=29/5/2006 8:00pm

C1=8 (Normal Hours)
D1=3 (Time & Half Hours)
E1=1.5 (Double Hours)


A1=[Date &Time] START
B1=[Date & Time] FINISH

C1=CALC Value()
D1=CALC Value()
E1=CALC Value()

How would i set this up so that i simply put in the DAT & TIME of A1 and
B1, and the hours are placed in their relative category?

Is this a VBA solution, or a Formula solution????

Corey...