DATEDIF formula that prorates

Lil Stinker

Board Regular
Joined
Feb 16, 2022
Messages
151
Office Version
  1. 2019
Platform
  1. Windows
Hey Folks-
I need help coming up with a formula that can calculate the weekly rental cost based on a one week minimum whether the rental term is a few days or, a week and a few days.

Basically, if they rent equipment for anywhere from 1-7 days, there is the weekly minimum cost of $150. However, if they extend over a week to, let's say, 10 days, then it needs to prorate to a daily cost ($21.43/day) after the one week minimum is met. So, a 10-day rental would come to $214.29, while a 4-day rental would be $150. Rates will vary, so $150 is just an example here.

Currently, part of our equipment rents on a one day, one week format so even if they rent equipment for 10 days, the cost will be for two weeks total. I use this DATEDIF formula below to calculate the weekly rental period there. Then I just multiply the cells to get the Subtotal. No issues.
=ROUNDUP((DATEDIF($E$11,$E$13,"d")/7),0))

However, if I try =ROUNDUP((DATEDIF($E$11,$E$13,"d")/7),2)), it breaks the week down in decimals, which is fine, but I don't know to lock in that first week and then start prorating only after 7 days.

Any suggestions would be greatly appreciated.

Sample table:
Book2
EFGHIJKL
7DescriptionColumn1Column2QTYUnit RateWeeksItem Subtotal
8Pickup DateWalkie Talkie15.001.00$5.00
92/14/2022  
10Billing Start  
112/14/2022  
12Billing End  
132/18/2022  
14Return Date  
152/19/2022  
16  
17  
18  
19Subtotal$5.00
22TOTAL AMOUNT$5.00
Sheet 1
Cell Formulas
RangeFormula
K8:K18K8=IF(ISBLANK(I8),"",ROUNDUP((DATEDIF($E$11,$E$13,"d")/7),0))
L8:L18L8=IF(ISBLANK(I8),"",I8*J8*K8)
L19L19=SUM(Table1[Item Subtotal])
L22L22=L21
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Not sure what this means:
if they rent equipment for 10 days, the cost will be for two weeks total.
Wouldn't that be $300 (150*2)?

If only using 3 cells (2 for dates and 1 for calculation), what about =IF(DAYS(D10,C10)>7,DAYS(D10,C10)*21.43,150)
where D10 is the return date, C10 the start date.
 
Upvote 0
Just get rate*days/7, then compare with 150, take the larger:

=MAX(J8,DATEDIF($E$11,$E$13,"d")*J8/7)
 
Upvote 0
Solution
Not sure what this means:

Wouldn't that be $300 (150*2)?

If only using 3 cells (2 for dates and 1 for calculation), what about =IF(DAYS(D10,C10)>7,DAYS(D10,C10)*21.43,150)
where D10 is the return date, C10 the start date.
Hello Micron-
We have two rental structures. One where equipment rented on a weekly basis is rounded up to a full week no matter whether you have the equipment out for 10 days or 14. So in that example, $150 for two weeks would come to $300.
The other structure includes prorating after the first week minimum, so the subtotal for a 10 day rental would be 150+(21.43*3)=$214.29, this is where I need the formula.
I can't use your formula because it includes the specific rate in the formula and rates will vary. It needs to be based on whatever rate is put in the Unit Rate column. In theory the formula works but it's not fluid.

Thanks for your input!
 
Upvote 0
Really, you don't say if the cell address for the rate is a constant with J8 or whatever, so it's up to you to swap that?? :rolleyes:
Doesn't matter - the other formula seems better to me anyway.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,286
Members
452,631
Latest member
a_potato

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