Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default //time calculations

Hi !! I have a table as below :

Date Time IN Date Time Out No. of hrs
01/09/2008 23:30 02/09/2008 1:30 2.00
02/09/2008 22:00 03/09/2008 2:30 4.30
03/09/2008 23:00 04/09/2008 0:30 1.30
04/09/2008 0:20 05/09/2008 0:50 0.30
05/09/2008 1:00 05/09/2008 2:00 1.00
06/09/2008 2:00 06/09/2008 3:00 1.00
07/09/2008 3:00 07/09/2008 4:00 1.00
08/09/2008 4:00 08/09/2008 5:00 1.00

Each day i record the vehicle in & out time at the warehouse.
1.) How can i automatically calculate the no of hrs the vehicle was at the wh.
2.) A also need the total no of hrs for a select period.
3.) How do i calculate the average time vehicle reaches the wh for a period.
4.) How do i calculate the average time vehicle leaves the wh for a period.
Simple average is not giving the correct result for IN-TIME & OUT-TIME ,
since in some case there is a change in the dates as well. Vehicle come in
the night but leaves post midnight when the date has also changed.
Pls. help me with this problem.
regards
Sansk_23


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default //time calculations

Assuming your dates to be in format dd/mm/yyyy (otherwise your mechanics are
very slow!)
this formula =(D1-B1+(C1-A1))*24 computes the time for first vehicle
Excel treats time as a fraction of a day.
I get values 2. 4.5, 1.5, 24.5, 1, 1, 1, 1 where 4.5 is 4 and 1/2 hours (not
4 h 5 min)

In J1 I entered a date (01/09/2008) and in K 1 I entered another
(05/09/2008)
In L1 I used =SUMPRODUCT(--(A1:A8=J1),--(A1:A8<=K1)) to tell me how many
vehicles were in during that period (5)
The total time for that period is given by
=SUMPRODUCT(--(A1:A8=J1),--(A1:A8<=K1),E1:E8) ---the answers is 33.5
The average time is L1/M1 (6.7 hours)

For more details on SUMPRODUCT
Bob Phillips
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
J.E McGimpsey
http://mcgimpsey.com/excel/formulae/doubleneg.html

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"sansk_23" wrote in message
...
Hi !! I have a table as below :

Date Time IN Date Time Out No. of hrs
01/09/2008 23:30 02/09/2008 1:30 2.00
02/09/2008 22:00 03/09/2008 2:30 4.30
03/09/2008 23:00 04/09/2008 0:30 1.30
04/09/2008 0:20 05/09/2008 0:50 0.30
05/09/2008 1:00 05/09/2008 2:00 1.00
06/09/2008 2:00 06/09/2008 3:00 1.00
07/09/2008 3:00 07/09/2008 4:00 1.00
08/09/2008 4:00 08/09/2008 5:00 1.00

Each day i record the vehicle in & out time at the warehouse.
1.) How can i automatically calculate the no of hrs the vehicle was at the
wh.
2.) A also need the total no of hrs for a select period.
3.) How do i calculate the average time vehicle reaches the wh for a
period.
4.) How do i calculate the average time vehicle leaves the wh for a
period.
Simple average is not giving the correct result for IN-TIME & OUT-TIME ,
since in some case there is a change in the dates as well. Vehicle come in
the night but leaves post midnight when the date has also changed.
Pls. help me with this problem.
regards
Sansk_23




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default //time calculations

Hi !! Thanks.
But, as desired in points 3 & 4,
i wanted the avergae IN-TIME & average OUT-TIME for the vehicles for a
select period.
And, simple avergae of column B & D does not give the correct avergae time,
because in some case the date changes.
If you could pls help me resolve this as well.
eg - if you average the data in column B, it gives - 9:51 (which doesnt make
any sense) since the vehicles are reaching the wh in the night.
rgds
Sansk_23


"Bernard Liengme" wrote:

Assuming your dates to be in format dd/mm/yyyy (otherwise your mechanics are
very slow!)
this formula =(D1-B1+(C1-A1))*24 computes the time for first vehicle
Excel treats time as a fraction of a day.
I get values 2. 4.5, 1.5, 24.5, 1, 1, 1, 1 where 4.5 is 4 and 1/2 hours (not
4 h 5 min)

In J1 I entered a date (01/09/2008) and in K 1 I entered another
(05/09/2008)
In L1 I used =SUMPRODUCT(--(A1:A8=J1),--(A1:A8<=K1)) to tell me how many
vehicles were in during that period (5)
The total time for that period is given by
=SUMPRODUCT(--(A1:A8=J1),--(A1:A8<=K1),E1:E8) ---the answers is 33.5
The average time is L1/M1 (6.7 hours)

For more details on SUMPRODUCT
Bob Phillips
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
J.E McGimpsey
http://mcgimpsey.com/excel/formulae/doubleneg.html

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"sansk_23" wrote in message
...
Hi !! I have a table as below :

Date Time IN Date Time Out No. of hrs
01/09/2008 23:30 02/09/2008 1:30 2.00
02/09/2008 22:00 03/09/2008 2:30 4.30
03/09/2008 23:00 04/09/2008 0:30 1.30
04/09/2008 0:20 05/09/2008 0:50 0.30
05/09/2008 1:00 05/09/2008 2:00 1.00
06/09/2008 2:00 06/09/2008 3:00 1.00
07/09/2008 3:00 07/09/2008 4:00 1.00
08/09/2008 4:00 08/09/2008 5:00 1.00

Each day i record the vehicle in & out time at the warehouse.
1.) How can i automatically calculate the no of hrs the vehicle was at the
wh.
2.) A also need the total no of hrs for a select period.
3.) How do i calculate the average time vehicle reaches the wh for a
period.
4.) How do i calculate the average time vehicle leaves the wh for a
period.
Simple average is not giving the correct result for IN-TIME & OUT-TIME ,
since in some case there is a change in the dates as well. Vehicle come in
the night but leaves post midnight when the date has also changed.
Pls. help me with this problem.
regards
Sansk_23





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default //time calculations

I used the formula =A1+B1 in G1 to add time to date
Copied this down to G8
In G9 I used =AVERAGE(G1:G8) to get 04/09/2008 21:51

If you do not want to devote a column to this use the single formula
=AVERAGE(A1:A8+B1:B8)
but commit it with SHIFT+CTRL+ENTER not just ENTER. Also Excel will not know
this is a date/time so you will need to give it a format like dd/mm/yyyy
h:mm

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"sansk_23" wrote in message
...
Hi !! Thanks.
But, as desired in points 3 & 4,
i wanted the avergae IN-TIME & average OUT-TIME for the vehicles for a
select period.
And, simple avergae of column B & D does not give the correct avergae
time,
because in some case the date changes.
If you could pls help me resolve this as well.
eg - if you average the data in column B, it gives - 9:51 (which doesnt
make
any sense) since the vehicles are reaching the wh in the night.
rgds
Sansk_23


"Bernard Liengme" wrote:

Assuming your dates to be in format dd/mm/yyyy (otherwise your mechanics
are
very slow!)
this formula =(D1-B1+(C1-A1))*24 computes the time for first vehicle
Excel treats time as a fraction of a day.
I get values 2. 4.5, 1.5, 24.5, 1, 1, 1, 1 where 4.5 is 4 and 1/2 hours
(not
4 h 5 min)

In J1 I entered a date (01/09/2008) and in K 1 I entered another
(05/09/2008)
In L1 I used =SUMPRODUCT(--(A1:A8=J1),--(A1:A8<=K1)) to tell me how many
vehicles were in during that period (5)
The total time for that period is given by
=SUMPRODUCT(--(A1:A8=J1),--(A1:A8<=K1),E1:E8) ---the answers is 33.5
The average time is L1/M1 (6.7 hours)

For more details on SUMPRODUCT
Bob Phillips
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
J.E McGimpsey
http://mcgimpsey.com/excel/formulae/doubleneg.html

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"sansk_23" wrote in message
...
Hi !! I have a table as below :

Date Time IN Date Time Out No. of hrs
01/09/2008 23:30 02/09/2008 1:30 2.00
02/09/2008 22:00 03/09/2008 2:30 4.30
03/09/2008 23:00 04/09/2008 0:30 1.30
04/09/2008 0:20 05/09/2008 0:50 0.30
05/09/2008 1:00 05/09/2008 2:00 1.00
06/09/2008 2:00 06/09/2008 3:00 1.00
07/09/2008 3:00 07/09/2008 4:00 1.00
08/09/2008 4:00 08/09/2008 5:00 1.00

Each day i record the vehicle in & out time at the warehouse.
1.) How can i automatically calculate the no of hrs the vehicle was at
the
wh.
2.) A also need the total no of hrs for a select period.
3.) How do i calculate the average time vehicle reaches the wh for a
period.
4.) How do i calculate the average time vehicle leaves the wh for a
period.
Simple average is not giving the correct result for IN-TIME & OUT-TIME
,
since in some case there is a change in the dates as well. Vehicle come
in
the night but leaves post midnight when the date has also changed.
Pls. help me with this problem.
regards
Sansk_23







  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default //time calculations

Hi. Thx.

Just wanted to check that if i make it a point to give the format as
dd/mm/yyyy
h:mm , in the column B & D -

1.) Do i still need to mention the date separately in the column A & C ?
2.) Does the formula for calculating the no. of hrs =(D1-B1+(C1-A1))*24 ,
also need to be changed / amended , or should give the same results ?

rgds
Sansk_23

"Bernard Liengme" wrote:

I used the formula =A1+B1 in G1 to add time to date
Copied this down to G8
In G9 I used =AVERAGE(G1:G8) to get 04/09/2008 21:51

If you do not want to devote a column to this use the single formula
=AVERAGE(A1:A8+B1:B8)
but commit it with SHIFT+CTRL+ENTER not just ENTER. Also Excel will not know
this is a date/time so you will need to give it a format like dd/mm/yyyy
h:mm

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"sansk_23" wrote in message
...
Hi !! Thanks.
But, as desired in points 3 & 4,
i wanted the avergae IN-TIME & average OUT-TIME for the vehicles for a
select period.
And, simple avergae of column B & D does not give the correct avergae
time,
because in some case the date changes.
If you could pls help me resolve this as well.
eg - if you average the data in column B, it gives - 9:51 (which doesnt
make
any sense) since the vehicles are reaching the wh in the night.
rgds
Sansk_23


"Bernard Liengme" wrote:

Assuming your dates to be in format dd/mm/yyyy (otherwise your mechanics
are
very slow!)
this formula =(D1-B1+(C1-A1))*24 computes the time for first vehicle
Excel treats time as a fraction of a day.
I get values 2. 4.5, 1.5, 24.5, 1, 1, 1, 1 where 4.5 is 4 and 1/2 hours
(not
4 h 5 min)

In J1 I entered a date (01/09/2008) and in K 1 I entered another
(05/09/2008)
In L1 I used =SUMPRODUCT(--(A1:A8=J1),--(A1:A8<=K1)) to tell me how many
vehicles were in during that period (5)
The total time for that period is given by
=SUMPRODUCT(--(A1:A8=J1),--(A1:A8<=K1),E1:E8) ---the answers is 33.5
The average time is L1/M1 (6.7 hours)

For more details on SUMPRODUCT
Bob Phillips
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
J.E McGimpsey
http://mcgimpsey.com/excel/formulae/doubleneg.html

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"sansk_23" wrote in message
...
Hi !! I have a table as below :

Date Time IN Date Time Out No. of hrs
01/09/2008 23:30 02/09/2008 1:30 2.00
02/09/2008 22:00 03/09/2008 2:30 4.30
03/09/2008 23:00 04/09/2008 0:30 1.30
04/09/2008 0:20 05/09/2008 0:50 0.30
05/09/2008 1:00 05/09/2008 2:00 1.00
06/09/2008 2:00 06/09/2008 3:00 1.00
07/09/2008 3:00 07/09/2008 4:00 1.00
08/09/2008 4:00 08/09/2008 5:00 1.00

Each day i record the vehicle in & out time at the warehouse.
1.) How can i automatically calculate the no of hrs the vehicle was at
the
wh.
2.) A also need the total no of hrs for a select period.
3.) How do i calculate the average time vehicle reaches the wh for a
period.
4.) How do i calculate the average time vehicle leaves the wh for a
period.
Simple average is not giving the correct result for IN-TIME & OUT-TIME
,
since in some case there is a change in the dates as well. Vehicle come
in
the night but leaves post midnight when the date has also changed.
Pls. help me with this problem.
regards
Sansk_23








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
Time Calculations LFP Excel Discussion (Misc queries) 1 February 7th 08 04:07 PM
Time calculations - help please Nananana Excel Discussion (Misc queries) 4 March 15th 07 01:10 PM
Time difference calculations, daylight savings time, Excel Tim Excel Discussion (Misc queries) 1 December 28th 06 04:18 PM
Overlapping time calculations and automatic time updates Arlette Excel Worksheet Functions 1 December 9th 06 12:20 AM
convert time imported as text to time format for calculations batfish Excel Worksheet Functions 3 October 27th 05 11:24 PM


All times are GMT +1. The time now is 02:59 AM.

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

About Us

"It's about Microsoft Excel"