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