Closed Thread
Results 1 to 10 of 10

Car Rental

Hybrid View

limecity Car Rental 11-18-2009, 03:27 AM
JBeaucaire Re: Car Rental 11-18-2009, 03:57 AM
DonkeyOte Re: Car Rental 11-18-2009, 04:01 AM
limecity Re: Car Rental 11-18-2009, 05:46 AM
limecity Re: Car Rental 11-18-2009, 12:24 PM
shg Re: Car Rental 11-18-2009, 12:34 PM
limecity Re: Car Rental 11-18-2009, 01:03 PM
shg Re: Car Rental 11-18-2009, 03:47 PM
limecity Re: Car Rental 11-18-2009, 08:18 PM
shg Re: Car Rental 11-18-2009, 08:20 PM
  1. #1
    Registered User
    Join Date
    11-18-2009
    Location
    Malaysia, Kuching
    MS-Off Ver
    Excel 2003
    Posts
    10

    Car Rental

    Hi

    I am trying to create a car rental spreadsheet for my own use but this one may be abit too complicated for me.

    I need the excel to help me to calculate the number of days and hours the car is used.

    Example:

    pickup car at 12 august 2009 at 9am in the morning
    return car at 14 august 2009 at 11am in the morning
    Output Total = 2 days + 2 hours rental

    The confusing part for me is having the extra 2 hours calculated.

    any help?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Car Rental

    A1 = 8/12/2009 9:00:00 AM
    B1 = 8/14/2009 11:00:00 AM

    C1 =B1-A1

    Highlight C1 and press CTRL-1 to open the format cell.
    Apply a custom number format of:

    d "days + "h "hours"

    ======
    Be sure to read through the Forum Rules so you can use and follow them effectively. For instance, you should edit that post above and change the title to something that indicates what this topic is. It's not car rentals. It's "adding/subtracting times over several days."
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Car Rental

    In addition to JB's post...

    If you want the resulting output in "days and hours" format then the next part will depend on whether total days can ever exceed 31 ?

    No:
    use format on C1 of: d "Day(s) & "h "Hour(s)"
    (or as already outlined by JB)

    Yes:
    probably best to use an adjacent formula given you can not show cumulative days above 31 via a Custom Format, ie
    D1: =INT(C1)&" Day(s) & "&HOUR(MOD(C1,1))&" Hour(s)"

    In the above we're assuming complete hours or rounded down hours, unspecified.

  4. #4
    Registered User
    Join Date
    11-18-2009
    Location
    Malaysia, Kuching
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Car Rental

    Oh thanks! I will try it out later.

  5. #5
    Registered User
    Join Date
    11-18-2009
    Location
    Malaysia, Kuching
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Car Rental

    I am getting some trouble with the

    total duration of rental time * rental rate

    the output didn't turn out what i expected.

    please do look into the attachment for the one i did.

    in the excel spreadsheet,

    ($100 x 3 days) + (2 hours x $10) = $339.17

    Isn't it suppose to be $320.00 ?
    Attached Files Attached Files

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Car Rental

    The formula in I17 could be

    =INT(C17-B17)*G17 + MOD(C17-B17, 1) * 24 * H17

    ... if you charge for fractional hours, or

    =INT(C17-B17)*G17 + ROUND(MOD(C17-B17, 1) * 24, 0) * H17

    ... if you round to the nearest hour, or

    =INT(C17-B17)*G17 + CEILING(ROUND(MOD(C17-B17, 1) * 24, 6), 1) * H17

    ... if you round to the next whole hour.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    11-18-2009
    Location
    Malaysia, Kuching
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Car Rental

    ah that works well ! thanks.

    and now i got the basic thing up. need to add another complicated matter.

    I need to set if the (rental hours) exceed 5 hours
    then Rental Day will be + 1

    meaning, if the rental is more than 5 hours, it will be charged as full day.
    tried something like this but.. i know its not right.

    =IF(E18<5, D18+1, FALSE)
    Last edited by limecity; 11-18-2009 at 01:05 PM.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Car Rental

    Maybe as attached.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-18-2009
    Location
    Malaysia, Kuching
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Car Rental

    appreciate your time and effort putting into this problem. :-D

    problems solved now :-D thank you very much

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Car Rental

    You're welcome. Would you take a minute to read the forum rules, and then mark the thread as Solved?

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1