0

I have recently taken over a web development project for a local car rental company and need help finding out how to calculate the Daily, Weekly, and Monthly cost of a vehicle.

The previous developer used a plugin that allowed you to create "Pricing Schemes" where you define a day range and its price:

19.99/day, 99.99/week, 299.99/month:

Day 1-5 = $19.99

Day 5-6 = $16.665

Day 6-7 = 14.284

Day 7-8 = $14.9975

and so on...

Sadly the developer left no notes on how he got these numbers and each pricing scheme he made only extends to the 31st day. Which causes an issue when a user wants to rent a car for longer than a month (Which is common).

What I need help finding out is the equation he used to get these numbers so I can add on to the pricing schemes and create others if the need arises. I will add a screenshot of a full pricing scheme for reference below.

Any help with this would be greatly appreciated and I will be available to answer any questions if my question is not clear enough. Thank you!

Screen Cap of Full Pricing scheme

Kevin Ullyott
  • 49
  • 1
  • 7
  • Does it make sense to use IIF, THEN statements here for each respective week(s)? – Geo Jul 18 '16 at 20:52
  • It does not sadly. The fields will only take number values – Kevin Ullyott Jul 18 '16 at 20:52
  • I'm confused here...what software/language/program are you using to write this equation? Can you be more specific in terms of "I need help writing the equation"? – Geo Jul 18 '16 at 20:55
  • Yes sorry, I don't need a programming equation, I need the actual MATH equation to figure out these numbers given a certain daily, weekly, and monthly rate. Perhaps I posted this in the wrong forum? – Kevin Ullyott Jul 18 '16 at 20:57
  • 1
    Just take the total they're going to pay and divide it by the number of days. For example, if they're renting for 6 days then they will take a weekly rental (since 6x the daily rate would cost more). So the daily rate for 6 days is 99.99 / 6 = 16.665. And so on for the others. – Matthew Strawbridge Jul 18 '16 at 21:18
  • Thank you, this helped a lot! – Kevin Ullyott Jul 18 '16 at 21:21

0 Answers0