Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
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:C4<0,0))-B2+(INDEX(C2:C4,MATCH(TRUE,C2:C4<0,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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
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:C100<0, 0))-B2+(INDEX(C2:C100,MATCH(TRUE,C2:C100<0,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:C4<0,0))-B2+(INDEX(C2:C4,MATCH(TRUE,C2:C4<0,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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
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:C4<0,0))-B2+(INDEX(C2:C4,MATCH(TRUE,C2:C4<0,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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
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(D2:D100,MATCH(TRUE,D2:D100<0, 0))-C2+(INDEX(D2:D100,MATCH(TRUE,D2:D100<0,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:C4<0,0))-B2+(INDEX(C2:C4,MATCH(TRUE,C2:C4<0,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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
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(D2:D100,MATCH(TRUE,D2:D100<0, 0))-C2+(INDEX(D2:D100,MATCH(TRUE,D2:D100<0,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:C4<0,0))-B2+(INDEX(C2:C4,MATCH(TRUE,C2:C4<0,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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
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$2:D2)-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(D2:D100,MATCH(TRUE,D2:D100<0, 0))-C2+(INDEX(D2:D100,MATCH(TRUE,D2:D100<0,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:C4<0,0))-B2+(INDEX(C2:C4,MATCH(TRUE,C2:C4<0,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



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 do I calculate duty times Sala New Users to Excel 1 December 23rd 08 01:18 PM
Rotating duty roster gramps Excel Discussion (Misc queries) 8 August 1st 07 12:04 PM
Stamp Duty Mr Stanley (UK) Excel Worksheet Functions 4 July 19th 06 11:49 AM
Please help with enclosed schedule of duty Huawei Excel Worksheet Functions 10 January 13th 06 02:46 PM
OT- Need to create an 11 & 12 man Duty Roster Gunjani Excel Worksheet Functions 0 May 20th 05 05:24 PM


All times are GMT +1. The time now is 10:24 AM.

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"