Calculating hours and Days

MattyMarco

New Member
Joined
Mar 23, 2011
Messages
2
Hi,
Im currently working for my dad (car hire company) and he needs me to make a spreadsheet that will calculate the number or hours between days.
E.g.
Because if someone collects a car at 12pm on 3/8/11 and brings it back before 12pm on the 4/8/11 the 24hr period is 1 day but if its brought back say 1pm then its 25 hours and it needs to show as 2 days.

any guidance would be a grat help, thanks!!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Hi and welcome to the forum.

Here is one way to do it. To keep the formula relatively simple I have used this layout.


Excel Workbook
ABCD
1Date OutDate InHours Diff#Days
203/08/2011 12:00 PM04/08/2011 11:00 AM230.96
303/08/2011 12:00 PM04/08/2011 01:00 PM251.08
403/08/2011 12:00 PM04/08/2011 03:00 PM271.17
Sheet1



Columns A and B are custom formatted :dd/mm/yyyy hh:mm AM/PM
Values are entered like: 03/08/2011 13:00:00

Column C just takes the time difference between the date in hours. custom formatted: [h]

As Column C is a still a time we need to use the INT() function to convert it before calculating the number of days in column D.

Hope this helps to get you started.

Bertie

Edit: To round the number of days off to a whole number you can wrap the CEILING function around the formula in column D

=CEILING(C4+INT(C4)/24,1)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,903
Members
452,948
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top