#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Time Format

HI All,

I am working in transport co. We are using software which give a report when
vehicles start and when ignition off and this software export the report in
..csv format. I want to calculate the type of trip whether the trip is
Business or private, business hours start from 06:00 to 17:00, if a vehicle
start after 6:00 and ignition off before 17:00 then trip count as Buiness, if
start before 6:00 and stop before 17:00 then trip should be Private /
Business, and start after 17:00 and stop before 6:00 the trip count Private.

I am getting the date in dd/mm/yyyy hh:mm:ss format from software, how i can
calculate trip type whether its Business or private?

Help required


Thanks & Regards

Hassan

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,480
Default Time Format

Hi

With Start time in A2 and End time in B2
Private Hours
=MAX(0,6-HOUR(A2))+(MAX(0,((HOUR(B2)+(24*(DAY(B2)DAY(A2)))-17))))
Business Hours
=MIN(17,(HOUR(B2)+(24*(DAY(B2)DAY(A2)))))-MAX(HOUR(A2),6)
--
Regards
Roger Govier



"Hassan" wrote in message
...
HI All,

I am working in transport co. We are using software which give a report
when
vehicles start and when ignition off and this software export the report
in
.csv format. I want to calculate the type of trip whether the trip is
Business or private, business hours start from 06:00 to 17:00, if a
vehicle
start after 6:00 and ignition off before 17:00 then trip count as Buiness,
if
start before 6:00 and stop before 17:00 then trip should be Private /
Business, and start after 17:00 and stop before 6:00 the trip count
Private.

I am getting the date in dd/mm/yyyy hh:mm:ss format from software, how i
can
calculate trip type whether its Business or private?

Help required


Thanks & Regards

Hassan



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 to format time in decimal format & calculate time Cheyenne Excel Discussion (Misc queries) 4 February 13th 09 04:34 PM
How to format time in decimal format & calculate time Cheyenne Excel Discussion (Misc queries) 1 February 13th 09 01:37 AM
How to format time in decimal format & calculate time Cheyenne Excel Discussion (Misc queries) 0 February 13th 09 12:49 AM
How to type format time in decimal format & calculate time Cheyenne Excel Discussion (Misc queries) 1 February 13th 09 12:09 AM
Remove time from a date and time field? Format removes the displa. oaoboc Excel Worksheet Functions 1 February 16th 05 07:20 PM


All times are GMT +1. The time now is 09:33 PM.

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"