A Microsoft Office (Excel, Word) forum. OfficeFrustration

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. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Duty Time Calculation



 
 
Thread Tools Display Modes
  #1  
Old October 8th, 2009, 08:12 PM posted to microsoft.public.excel.misc
JB Bates[_2_]
external usenet poster
 
Posts: 37
Default Duty Time Calculation

I want to calculate duty time, but where the crew may not be on and
off duty the same leg - can you advise how i would do that?

Duty On Duty Off
Leg 1 13:00
Leg 2
Leg 3 23:30

how can I have it look at the duty off column and keep looking till it finds
a time? and getting the result as 10.5 Hours

thanks

  #2  
Old October 8th, 2009, 08:25 PM posted to microsoft.public.excel.misc
Mike H
external usenet poster
 
Posts: 8,419
Default Duty Time Calculation

Hi,

In your sample date you show 3 legs and I've assumed this is the max so only
look down 3 rows in column C. If it could be more then change c4 in the
formula to C5 for 4 rows. This is an array formula. See below on how to
enter. Put it in (say) d2 array enter and drag down. Every time it finds a
valu in column B it looks for the finish time in column C

=IF(B2="","",(INDEX(C2:C4,MATCH(TRUE,C2:C40,0))-B2+(INDEX(C2:C4,MATCH(TRUE,C2:C40,0))B2))*24)

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly and look in the formula bar
'then Excel will have put curly brackets around the formula {}.
'You can't type these yourself and If you edit the formula
'you must enter it again with CTRL+Shift+Enter.


Mike

"JB Bates" wrote:

I want to calculate duty time, but where the crew may not be on and
off duty the same leg - can you advise how i would do that?

Duty On Duty Off
Leg 1 13:00
Leg 2
Leg 3 23:30

how can I have it look at the duty off column and keep looking till it finds
a time? and getting the result as 10.5 Hours

thanks

  #3  
Old October 8th, 2009, 08:31 PM posted to microsoft.public.excel.misc
Mike H
external usenet poster
 
Posts: 8,419
Default Duty Time Calculation

Hi,

On reflection it doesn't have to have a limited amount of rows to look down

=IF(B2="","",(INDEX(C2:C100,MATCH(TRUE,C2:C1000, 0))-B2+(INDEX(C2:C100,MATCH(TRUE,C2:C1000,0))B2))*2 4)

This now look for up to 99 rows

Mike

"Mike H" wrote:

Hi,

In your sample date you show 3 legs and I've assumed this is the max so only
look down 3 rows in column C. If it could be more then change c4 in the
formula to C5 for 4 rows. This is an array formula. See below on how to
enter. Put it in (say) d2 array enter and drag down. Every time it finds a
valu in column B it looks for the finish time in column C

=IF(B2="","",(INDEX(C2:C4,MATCH(TRUE,C2:C40,0))-B2+(INDEX(C2:C4,MATCH(TRUE,C2:C40,0))B2))*24)

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly and look in the formula bar
'then Excel will have put curly brackets around the formula {}.
'You can't type these yourself and If you edit the formula
'you must enter it again with CTRL+Shift+Enter.


Mike

"JB Bates" wrote:

I want to calculate duty time, but where the crew may not be on and
off duty the same leg - can you advise how i would do that?

Duty On Duty Off
Leg 1 13:00
Leg 2
Leg 3 23:30

how can I have it look at the duty off column and keep looking till it finds
a time? and getting the result as 10.5 Hours

thanks

  #4  
Old October 8th, 2009, 08:44 PM posted to microsoft.public.excel.misc
JB Bates[_2_]
external usenet poster
 
Posts: 37
Default Duty Time Calculation

Hi Mike

The max legs I cna have is 10. But I could potentially end up with the
following scenario. can I adjust this formula to fit? I just dont know when
duty on / duty off will happen in advance - so i want a formula that can
accomodate when it finds data.

possible example
A B C D
E
Duty On Duty Off
Total Duty
Leg 1 10/6/09 13:00 17:00 4.0
Leg 2 10/7/09 08:00
Leg 3 10/7/09
Leg 4 10/7/09 18:00 10.0
Leg 5 10/9/09 17:00
Leg 6 10/9/09
Leg 7 10/9/09
Leg 8 10/9/09 03:30 10.5
Leg 9
Leg 10

THANKS in Advance - I really appreciate your help. JB

"Mike H" wrote:

Hi,

In your sample date you show 3 legs and I've assumed this is the max so only
look down 3 rows in column C. If it could be more then change c4 in the
formula to C5 for 4 rows. This is an array formula. See below on how to
enter. Put it in (say) d2 array enter and drag down. Every time it finds a
valu in column B it looks for the finish time in column C

=IF(B2="","",(INDEX(C2:C4,MATCH(TRUE,C2:C40,0))-B2+(INDEX(C2:C4,MATCH(TRUE,C2:C40,0))B2))*24)

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly and look in the formula bar
'then Excel will have put curly brackets around the formula {}.
'You can't type these yourself and If you edit the formula
'you must enter it again with CTRL+Shift+Enter.


Mike

"JB Bates" wrote:

I want to calculate duty time, but where the crew may not be on and
off duty the same leg - can you advise how i would do that?

Duty On Duty Off
Leg 1 13:00
Leg 2
Leg 3 23:30

how can I have it look at the duty off column and keep looking till it finds
a time? and getting the result as 10.5 Hours

thanks

  #5  
Old October 8th, 2009, 09:01 PM posted to microsoft.public.excel.misc
Mike H
external usenet poster
 
Posts: 8,419
Default Duty Time Calculation

Hi,

The formula I gave you does exactly that and here it is modified for times
in columns C&D.

Don't forget to array enter it, if your not sure read my first post again on
how to enter an array formula.

=IF(C2="","",(INDEX(D2100,MATCH(TRUE,D21000, 0))-C2+(INDEX(D2100,MATCH(TRUE,D21000,0))C2))*2 4)

Mike

"JB Bates" wrote:

Hi Mike

The max legs I cna have is 10. But I could potentially end up with the
following scenario. can I adjust this formula to fit? I just dont know when
duty on / duty off will happen in advance - so i want a formula that can
accomodate when it finds data.

possible example
A B C D
E
Duty On Duty Off
Total Duty
Leg 1 10/6/09 13:00 17:00 4.0
Leg 2 10/7/09 08:00
Leg 3 10/7/09
Leg 4 10/7/09 18:00 10.0
Leg 5 10/9/09 17:00
Leg 6 10/9/09
Leg 7 10/9/09
Leg 8 10/9/09 03:30 10.5
Leg 9
Leg 10

THANKS in Advance - I really appreciate your help. JB

"Mike H" wrote:

Hi,

In your sample date you show 3 legs and I've assumed this is the max so only
look down 3 rows in column C. If it could be more then change c4 in the
formula to C5 for 4 rows. This is an array formula. See below on how to
enter. Put it in (say) d2 array enter and drag down. Every time it finds a
valu in column B it looks for the finish time in column C

=IF(B2="","",(INDEX(C2:C4,MATCH(TRUE,C2:C40,0))-B2+(INDEX(C2:C4,MATCH(TRUE,C2:C40,0))B2))*24)

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly and look in the formula bar
'then Excel will have put curly brackets around the formula {}.
'You can't type these yourself and If you edit the formula
'you must enter it again with CTRL+Shift+Enter.


Mike

"JB Bates" wrote:

I want to calculate duty time, but where the crew may not be on and
off duty the same leg - can you advise how i would do that?

Duty On Duty Off
Leg 1 13:00
Leg 2
Leg 3 23:30

how can I have it look at the duty off column and keep looking till it finds
a time? and getting the result as 10.5 Hours

thanks

  #6  
Old October 8th, 2009, 09:17 PM posted to microsoft.public.excel.misc
JB Bates[_2_]
external usenet poster
 
Posts: 37
Default Duty Time Calculation

Hi Mike

Thanks again. I was able to enter the array formula with success. this may
seem minor, but since you are so knowledgable i thought you might know.

Here is what I got when I did this

Leg 1 10/6/09 13:00 17:00 4
Leg 2 10/7/09 8:00 10
Leg 3 10/7/09
Leg 4 10/7/09 18:00
Leg 5 10/9/09 17:00 10.5
Leg 6 10/9/09
Leg 7 10/9/09
Leg 8 10/9/09 3:30
Leg 9
Leg 10


IS there a way to have it display the total duty time on the row that houses
the duty off time?

Really, really appreciate all your help with this!! JB

"Mike H" wrote:

Hi,

The formula I gave you does exactly that and here it is modified for times
in columns C&D.

Don't forget to array enter it, if your not sure read my first post again on
how to enter an array formula.

=IF(C2="","",(INDEX(D2100,MATCH(TRUE,D21000, 0))-C2+(INDEX(D2100,MATCH(TRUE,D21000,0))C2))*2 4)

Mike

"JB Bates" wrote:

Hi Mike

The max legs I cna have is 10. But I could potentially end up with the
following scenario. can I adjust this formula to fit? I just dont know when
duty on / duty off will happen in advance - so i want a formula that can
accomodate when it finds data.

possible example
A B C D
E
Duty On Duty Off
Total Duty
Leg 1 10/6/09 13:00 17:00 4.0
Leg 2 10/7/09 08:00
Leg 3 10/7/09
Leg 4 10/7/09 18:00 10.0
Leg 5 10/9/09 17:00
Leg 6 10/9/09
Leg 7 10/9/09
Leg 8 10/9/09 03:30 10.5
Leg 9
Leg 10

THANKS in Advance - I really appreciate your help. JB

"Mike H" wrote:

Hi,

In your sample date you show 3 legs and I've assumed this is the max so only
look down 3 rows in column C. If it could be more then change c4 in the
formula to C5 for 4 rows. This is an array formula. See below on how to
enter. Put it in (say) d2 array enter and drag down. Every time it finds a
valu in column B it looks for the finish time in column C

=IF(B2="","",(INDEX(C2:C4,MATCH(TRUE,C2:C40,0))-B2+(INDEX(C2:C4,MATCH(TRUE,C2:C40,0))B2))*24)

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly and look in the formula bar
'then Excel will have put curly brackets around the formula {}.
'You can't type these yourself and If you edit the formula
'you must enter it again with CTRL+Shift+Enter.


Mike

"JB Bates" wrote:

I want to calculate duty time, but where the crew may not be on and
off duty the same leg - can you advise how i would do that?

Duty On Duty Off
Leg 1 13:00
Leg 2
Leg 3 23:30

how can I have it look at the duty off column and keep looking till it finds
a time? and getting the result as 10.5 Hours

thanks

  #7  
Old October 9th, 2009, 06:16 AM posted to microsoft.public.excel.misc
T. Valko
external usenet poster
 
Posts: 15,759
Default Duty Time Calculation

Try this:

Start times in column C starting in cell C2
End times in column D starting in cell D2

Enter this formula in E2 and copy down as needed:

=IF(D2="","",ROUND(MOD(LOOKUP(2,D$22)-LOOKUP(2,C$2:C2),1)*24,2))

--
Biff
Microsoft Excel MVP


"JB Bates" wrote in message
...
Hi Mike

Thanks again. I was able to enter the array formula with success. this
may
seem minor, but since you are so knowledgable i thought you might know.

Here is what I got when I did this

Leg 1 10/6/09 13:00 17:00 4
Leg 2 10/7/09 8:00 10
Leg 3 10/7/09
Leg 4 10/7/09 18:00
Leg 5 10/9/09 17:00 10.5
Leg 6 10/9/09
Leg 7 10/9/09
Leg 8 10/9/09 3:30
Leg 9
Leg 10


IS there a way to have it display the total duty time on the row that
houses
the duty off time?

Really, really appreciate all your help with this!! JB

"Mike H" wrote:

Hi,

The formula I gave you does exactly that and here it is modified for
times
in columns C&D.

Don't forget to array enter it, if your not sure read my first post again
on
how to enter an array formula.

=IF(C2="","",(INDEX(D2100,MATCH(TRUE,D21000, 0))-C2+(INDEX(D2100,MATCH(TRUE,D21000,0))C2))*2 4)

Mike

"JB Bates" wrote:

Hi Mike

The max legs I cna have is 10. But I could potentially end up with the
following scenario. can I adjust this formula to fit? I just dont
know when
duty on / duty off will happen in advance - so i want a formula that
can
accomodate when it finds data.

possible example
A B C D
E
Duty On Duty Off
Total Duty
Leg 1 10/6/09 13:00 17:00
4.0
Leg 2 10/7/09 08:00
Leg 3 10/7/09
Leg 4 10/7/09 18:00
10.0
Leg 5 10/9/09 17:00
Leg 6 10/9/09
Leg 7 10/9/09
Leg 8 10/9/09 03:30
10.5
Leg 9
Leg 10

THANKS in Advance - I really appreciate your help. JB

"Mike H" wrote:

Hi,

In your sample date you show 3 legs and I've assumed this is the max
so only
look down 3 rows in column C. If it could be more then change c4 in
the
formula to C5 for 4 rows. This is an array formula. See below on how
to
enter. Put it in (say) d2 array enter and drag down. Every time it
finds a
valu in column B it looks for the finish time in column C

=IF(B2="","",(INDEX(C2:C4,MATCH(TRUE,C2:C40,0))-B2+(INDEX(C2:C4,MATCH(TRUE,C2:C40,0))B2))*24)

This is an array formula which must be entered by pressing
CTRL+Shift+Enter
'and not just Enter. If you do it correctly and look in the formula
bar
'then Excel will have put curly brackets around the formula {}.
'You can't type these yourself and If you edit the formula
'you must enter it again with CTRL+Shift+Enter.


Mike

"JB Bates" wrote:

I want to calculate duty time, but where the crew may not be on and
off duty the same leg - can you advise how i would do that?

Duty On Duty Off
Leg 1 13:00
Leg 2
Leg 3 23:30

how can I have it look at the duty off column and keep looking till
it finds
a time? and getting the result as 10.5 Hours

thanks



  #8  
Old October 9th, 2009, 04:53 PM posted to microsoft.public.excel.misc
JB Bates[_2_]
external usenet poster
 
Posts: 37
Default Duty Time Calculation

Thanks Biff -- worked like a charm!!

"T. Valko" wrote:

Try this:

Start times in column C starting in cell C2
End times in column D starting in cell D2

Enter this formula in E2 and copy down as needed:

=IF(D2="","",ROUND(MOD(LOOKUP(2,D$22)-LOOKUP(2,C$2:C2),1)*24,2))

--
Biff
Microsoft Excel MVP


"JB Bates" wrote in message
...
Hi Mike

Thanks again. I was able to enter the array formula with success. this
may
seem minor, but since you are so knowledgable i thought you might know.

Here is what I got when I did this

Leg 1 10/6/09 13:00 17:00 4
Leg 2 10/7/09 8:00 10
Leg 3 10/7/09
Leg 4 10/7/09 18:00
Leg 5 10/9/09 17:00 10.5
Leg 6 10/9/09
Leg 7 10/9/09
Leg 8 10/9/09 3:30
Leg 9
Leg 10


IS there a way to have it display the total duty time on the row that
houses
the duty off time?

Really, really appreciate all your help with this!! JB

"Mike H" wrote:

Hi,

The formula I gave you does exactly that and here it is modified for
times
in columns C&D.

Don't forget to array enter it, if your not sure read my first post again
on
how to enter an array formula.

=IF(C2="","",(INDEX(D2100,MATCH(TRUE,D21000, 0))-C2+(INDEX(D2100,MATCH(TRUE,D21000,0))C2))*2 4)

Mike

"JB Bates" wrote:

Hi Mike

The max legs I cna have is 10. But I could potentially end up with the
following scenario. can I adjust this formula to fit? I just dont
know when
duty on / duty off will happen in advance - so i want a formula that
can
accomodate when it finds data.

possible example
A B C D
E
Duty On Duty Off
Total Duty
Leg 1 10/6/09 13:00 17:00
4.0
Leg 2 10/7/09 08:00
Leg 3 10/7/09
Leg 4 10/7/09 18:00
10.0
Leg 5 10/9/09 17:00
Leg 6 10/9/09
Leg 7 10/9/09
Leg 8 10/9/09 03:30
10.5
Leg 9
Leg 10

THANKS in Advance - I really appreciate your help. JB

"Mike H" wrote:

Hi,

In your sample date you show 3 legs and I've assumed this is the max
so only
look down 3 rows in column C. If it could be more then change c4 in
the
formula to C5 for 4 rows. This is an array formula. See below on how
to
enter. Put it in (say) d2 array enter and drag down. Every time it
finds a
valu in column B it looks for the finish time in column C

=IF(B2="","",(INDEX(C2:C4,MATCH(TRUE,C2:C40,0))-B2+(INDEX(C2:C4,MATCH(TRUE,C2:C40,0))B2))*24)

This is an array formula which must be entered by pressing
CTRL+Shift+Enter
'and not just Enter. If you do it correctly and look in the formula
bar
'then Excel will have put curly brackets around the formula {}.
'You can't type these yourself and If you edit the formula
'you must enter it again with CTRL+Shift+Enter.


Mike

"JB Bates" wrote:

I want to calculate duty time, but where the crew may not be on and
off duty the same leg - can you advise how i would do that?

Duty On Duty Off
Leg 1 13:00
Leg 2
Leg 3 23:30

how can I have it look at the duty off column and keep looking till
it finds
a time? and getting the result as 10.5 Hours

thanks




  #9  
Old October 9th, 2009, 05:28 PM posted to microsoft.public.excel.misc
T. Valko
external usenet poster
 
Posts: 15,759
Default Duty Time Calculation

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"JB Bates" wrote in message
...
Thanks Biff -- worked like a charm!!

"T. Valko" wrote:

Try this:

Start times in column C starting in cell C2
End times in column D starting in cell D2

Enter this formula in E2 and copy down as needed:

=IF(D2="","",ROUND(MOD(LOOKUP(2,D$22)-LOOKUP(2,C$2:C2),1)*24,2))

--
Biff
Microsoft Excel MVP


"JB Bates" wrote in message
...
Hi Mike

Thanks again. I was able to enter the array formula with success.
this
may
seem minor, but since you are so knowledgable i thought you might know.

Here is what I got when I did this

Leg 1 10/6/09 13:00 17:00 4
Leg 2 10/7/09 8:00 10
Leg 3 10/7/09
Leg 4 10/7/09 18:00
Leg 5 10/9/09 17:00 10.5
Leg 6 10/9/09
Leg 7 10/9/09
Leg 8 10/9/09 3:30
Leg 9
Leg 10


IS there a way to have it display the total duty time on the row that
houses
the duty off time?

Really, really appreciate all your help with this!! JB

"Mike H" wrote:

Hi,

The formula I gave you does exactly that and here it is modified for
times
in columns C&D.

Don't forget to array enter it, if your not sure read my first post
again
on
how to enter an array formula.

=IF(C2="","",(INDEX(D2100,MATCH(TRUE,D21000, 0))-C2+(INDEX(D2100,MATCH(TRUE,D21000,0))C2))*2 4)

Mike

"JB Bates" wrote:

Hi Mike

The max legs I cna have is 10. But I could potentially end up with
the
following scenario. can I adjust this formula to fit? I just dont
know when
duty on / duty off will happen in advance - so i want a formula that
can
accomodate when it finds data.

possible example
A B C D
E
Duty On Duty Off
Total Duty
Leg 1 10/6/09 13:00 17:00
4.0
Leg 2 10/7/09 08:00
Leg 3 10/7/09
Leg 4 10/7/09 18:00
10.0
Leg 5 10/9/09 17:00
Leg 6 10/9/09
Leg 7 10/9/09
Leg 8 10/9/09 03:30
10.5
Leg 9
Leg 10

THANKS in Advance - I really appreciate your help. JB

"Mike H" wrote:

Hi,

In your sample date you show 3 legs and I've assumed this is the
max
so only
look down 3 rows in column C. If it could be more then change c4
in
the
formula to C5 for 4 rows. This is an array formula. See below on
how
to
enter. Put it in (say) d2 array enter and drag down. Every time it
finds a
valu in column B it looks for the finish time in column C

=IF(B2="","",(INDEX(C2:C4,MATCH(TRUE,C2:C40,0))-B2+(INDEX(C2:C4,MATCH(TRUE,C2:C40,0))B2))*24)

This is an array formula which must be entered by pressing
CTRL+Shift+Enter
'and not just Enter. If you do it correctly and look in the
formula
bar
'then Excel will have put curly brackets around the formula {}.
'You can't type these yourself and If you edit the formula
'you must enter it again with CTRL+Shift+Enter.


Mike

"JB Bates" wrote:

I want to calculate duty time, but where the crew may not be on
and
off duty the same leg - can you advise how i would do that?

Duty On Duty Off
Leg 1 13:00
Leg 2
Leg 3 23:30

how can I have it look at the duty off column and keep looking
till
it finds
a time? and getting the result as 10.5 Hours

thanks






 




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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:21 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.