# Calculate Date Difference in terms of Hours

1. ## Calculate Date Difference in terms of Hours

I'm trying to help my brother who had this MS Excel assignment and I can't seem to get the right formula/logical argument for the conditions set in the problem.

The Problem is stated as:

"A car rental service posted a promo online where every vehicle will be rented for only \$5 per day with \$2 per hour if renter exceeds the prescribed period. If Alex Cooper rented a car at 7:00 AM of September 30 and returned it by 7:00 PM the following day, how much will he pay?"

I placed A1 as Date of Release, B1 as Date Returned, C1 as Duration, D1 as Excess Hours, E1 as total.
I got the duration simply by subtracting A1 and B1, but the excess hours doesn't seem to work correctly.  Register To Reply

2. ## Re: Calculate Date Difference in terms of Hours

I got the duration simply by subtracting C1 and B1
I suppose you men subtracting A1 from B1 ?
Perhaps try
Formula:  `Please Login or Register  to view this content.`
in D1  Register To Reply

3. ## Re: Calculate Date Difference in terms of Hours

this will only compute the duration but not the excess hours, sir  Register To Reply

4. ## Re: Calculate Date Difference in terms of Hours

if C1 is a plain number, then try this in D1: ``Please Login or Register  to view this content.``
note: this assumes that C1 is where you enter the duration that is hired.

if not, then without the duration hired for (the 8 hours) you can not do the calculation because who is to say how long it was hired for   Register To Reply

5. ## Re: Calculate Date Difference in terms of Hours

There are instructions at the top of the page explaining how to attach your sample workbook.  Register To Reply

6. ## Re: Calculate Date Difference in terms of Hours

Using Pepe Le Mokko's approach, I guess excess hours is; ``Please Login or Register  to view this content.``  Register To Reply

7. ## Re: Calculate Date Difference in terms of Hours Originally Posted by wedzmer this will only compute the duration but not the excess hours, sir
I think you might need to review the MOD function which gives the remainder of a division so MOD(66,24)=18 for example  Register To Reply