Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 96
Default Date and time calculations

I have a spreadsheet for towed vehicles. If I have an IN Column that has a
date and time and an OUT column that has a date and time released. I also
have a column that has amounts of charges ($45.00 per day) In the third
column I would like a calculation based on the In and Out times: Example, if
a vehicle is picked up before 2 hours, there is no charge, after 2 hours the
same day, 1 day of storage is charged. If a vehicle is picked up the next
day before 1400 hrs - one day charged, but if the vehicle is picked up 1401
hrs - two days storage is charged. etc.
Is there a formula that would calculate based on the hours and days? Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Date and time calculations


try:

=IF(DATEDIF(A2,B2,"d")=0,IF(ROUND(MOD(B2-A2,1)*24,2)<=2,0,1),IF(TIME(HOUR(B2),MINUTE(B2),0) <=TIME(14,0,0),DATEDIF(A2,B2,"d"),DATEDIF(A2,B2,"d ")+1))

to give number of days to charge

A2 = IN
B2= OUT

"Pammy" wrote:

I have a spreadsheet for towed vehicles. If I have an IN Column that has a
date and time and an OUT column that has a date and time released. I also
have a column that has amounts of charges ($45.00 per day) In the third
column I would like a calculation based on the In and Out times: Example, if
a vehicle is picked up before 2 hours, there is no charge, after 2 hours the
same day, 1 day of storage is charged. If a vehicle is picked up the next
day before 1400 hrs - one day charged, but if the vehicle is picked up 1401
hrs - two days storage is charged. etc.
Is there a formula that would calculate based on the hours and days? 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
Date & Time Calculations Motaad Excel Worksheet Functions 0 March 8th 07 08:27 PM
Date and Time Calculations Wayne Excel Discussion (Misc queries) 3 October 26th 06 08:51 PM
Date/Time Calculations IGWright Excel Worksheet Functions 4 May 23rd 06 08:37 AM
Time and date calculations Bob Excel Worksheet Functions 1 February 22nd 05 04:05 PM
Date and time calculations Tony Excel Discussion (Misc queries) 2 January 8th 05 05:16 PM


All times are GMT +1. The time now is 07:56 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"