Fixed minimum rate for prorating calculation

Lil Stinker

Board Regular
Joined
Feb 16, 2022
Messages
151
Office Version
  1. 2019
Platform
  1. Windows
Hello-
I'm looking for a way to fix in a minimum rate when calculating for monthly or weekly rental terms. In the samples below, I have the same table indicating the result for a monthly rental and a weekly rental based on a drop down in column E. The idea is the user will select Months or Weeks based on the term they are choosing for the rental when placing an order. Each term however, has a minimum rental rate regardless of which is chosen. Weekly rentals have a minimum 7-day rental while Monthly has a minimum one month rental. If a weekly rental is selected but the duration is less than 7 days, it should still total whatever weekly rate is listed in the Unit Rate column rather than breaking it down by the day as it currently does. Same for when a monthly rental is selected on the form, if the duration is less than a month, it should still total the monthly rate listed in column D. It is only after the minimum is met, does the rental start to prorate.

The two tables I have off to the right are there for calculating the proration for either rental term. I have it set up this way because this seems to produce the most accurate proration of rental rates for our needs. The problem is, it does not factor in a minimum rental period. So, I don't know if a more detailed IF statement in the Item Subtotal column is the way to go or if different formulas are needed in each of the calculation tables to factor in the minimum rental rate but I do know that I'm not smart enough to figure it out.

Any help would be greatly appreciated.

(By the way, this is meant to be used for drafting quotes to our clients. The start and end dates, equipment and rental rates are not fixed and will vary per quote).

ORDER FORM -formula tests- 2022.xlsx
ABCDEFGHIJKLMNOPQRS
17DescriptionQTYUnit RateMonthsItem Subtotal[ Term ]MonthsWeeksDaysWeekly RateDaily RateSubtotalWeeksDaysDaily RateSubtotal
18Computer Monitor1200.003w,6d$192.84Months0.003.006.0050.007.14192.843.006.0028.57771.42
19Speaker Set250.003w,6d$96.48Weeks0.003.006.0012.501.7996.483.006.007.14385.68
20Start DateKeyboard & Mouse Set120.003w,6d$19.260.003.006.005.000.7119.263.006.002.8677.16
2103/01/22Computer Tower1500.003w,6d$482.160.003.006.00125.0017.86482.163.006.0071.431928.58
22End Date            
2303/28/22            
24            
25            
26            
27Subtotal$790.74  
28Discount$0.00  
29Net Amount$790.74  
30TOTAL AMOUNT$790.74  
31
32DescriptionQTYUnit RateWeeksItem Subtotal[ Term ]MonthsWeeksDaysWeekly RateDaily RateSubtotalWeeksDaysDaily RateSubtotal
33Computer Monitor1200.006d$171.42Months0.000.006.0050.007.1442.840.006.0028.57171.42
34Speaker Set250.006d$85.68Weeks0.000.006.0012.501.7921.480.006.007.1485.68
35Start DateKeyboard & Mouse Set120.006d$17.160.000.006.005.000.714.260.006.002.8617.16
3604/01/22Computer Tower1500.006d$428.580.000.006.00125.0017.86107.160.006.0071.43428.58
37End Date            
3804/07/22            
39            
40            
41            
42Subtotal$702.84  
43Discount$0.00  
44Net Amount$702.84  
45TOTAL AMOUNT$702.84  
Sheet 2
Cell Formulas
RangeFormula
I18:I26I18=IF(ISBLANK(C18),"",DATEDIF($A$21,$A$23,"M"))
J18:J26J18=IF(ISBLANK(C18),"",INT(($A$23-EDATE($A$21,DATEDIF($A$21,$A$23,"m")))/7))
K18:K26K18=IF(ISBLANK(C18),"",MOD($A$23-EDATE($A$21,DATEDIF($A$21,$A$23,"m")),7))
L33:L41,L18:L26L18=IF(ISBLANK(C18),"",(ROUND(D18/4,2)))
M33:M41,M18:M26M18=IF(ISBLANK(C18),"",(ROUND(L18/7,2)))
N33:N41,N18:N26N18=IF(ISBLANK(C18),"",(D18*I18+L18*J18+M18*K18)*C18)
P18:P26P18=IF(ISBLANK(C18),"",INT((DATEDIF($A$21,$A$23,"d")/7)))
Q18:Q26Q18=IF(ISBLANK(C18),"",MOD($A$23-EDATE($A$21,DATEDIF($A$21,$A$23,"m")),7))
R33:R41,R18:R26R18=IF(ISBLANK(C18),"",(ROUND(D18/7,2)))
S33:S41,S18:S26S18=IF(ISBLANK(C18),"",(D18*P18+R18*Q18)*C18)
E18:E26E18=IF(OR($B18="",AND(E$17<>"Months",E$17<>"Weeks")),"", SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(IF(E$17="Months",DATEDIF($A$21,$A$23,"m")&"m,"&INT(($A$23-EDATE($A$21,DATEDIF($A$21,$A$23,"m")))/7)&"w,"&MOD($A$23-EDATE($A$21,DATEDIF($A$21,$A$23,"m")),7)&"d", INT(($A$23-$A$21)/7)&"w,"&MOD($A$23-$A$21,7)&"d"),"0m,",""),"0w,",""),",0d",""))
F18:F26F18=IF(ISBLANK(C18),"",IF(E$17="Months",(D18*I18+L18*J18+M18*K18)*C18,IF(E$17="Weeks",((D18*P18+R18*Q18)*C18))))
F27F27=SUBTOTAL(109,Table2261013[Item Subtotal])
L42:L45,L27:L30L27=IF(ISBLANK(C22),"",(ROUND(K27/7,2)))
M42:M45,M27:M30M27=IF(ISBLANK(C22),"",(D22*H27+K27*I27+L27*J27)*C22)
F29,F44F29=(F27-(F27*F28))
F30,F45F30=F29
I33:I41I33=IF(ISBLANK(C33),"",DATEDIF($A$36,$A$38,"M"))
J33:J41J33=IF(ISBLANK(C33),"",INT(($A$38-EDATE($A$36,DATEDIF($A$36,$A$38,"m")))/7))
K33:K41K33=IF(ISBLANK(C33),"",MOD($A$38-EDATE($A$36,DATEDIF($A$36,$A$38,"m")),7))
P33:P41P33=IF(ISBLANK(C33),"",INT((DATEDIF($A$36,$A$38,"d")/7)))
Q33:Q41Q33=IF(ISBLANK(C33),"",MOD($A$38-EDATE($A$36,DATEDIF($A$36,$A$38,"m")),7))
E33:E41E33=IF(OR($B33="",AND(E$32<>"Months",E$32<>"Weeks")),"", SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(IF(E$32="Months",DATEDIF($A$36,$A$38,"m")&"m,"&INT(($A$38-EDATE($A$36,DATEDIF($A$36,$A$38,"m")))/7)&"w,"&MOD($A$38-EDATE($A$36,DATEDIF($A$36,$A$38,"m")),7)&"d", INT(($A$38-$A$36)/7)&"w,"&MOD($A$38-$A$36,7)&"d"),"0m,",""),"0w,",""),",0d",""))
F33:F41F33=IF(ISBLANK(C33),"",IF(E$32="Months",(D33*I33+L33*J33+M33*K33)*C33,IF(E$32="Weeks",((D33*P33+R33*Q33)*C33))))
F42F42=SUBTOTAL(109,Table226101316[Item Subtotal])
Cells with Data Validation
CellAllowCriteria
E17List=$H$1:$H$3
E32List=$H$1:$H$3
 
I see. For arguments sake, if I wanted it to display MWD regardless of the option selected (ie, Custom, Weeks, Days), I would just add those to the OR statement?
(OR(I18=“Months”,I18=“Weeks”,I18=“Days”,I18=“Custom”),…
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
if I wanted it to display MWD regardless of the option selected (ie, Custom, Weeks, Days), I would just add those to the OR statement?
Yes...you could, but if that were the case, then an OR statement is not needed. If any selection (Custom, Months, etc.) should result in the number of months displaying, without exception, then
Excel Formula:
=IF(ISBLANK(C18),"",DATEDIF($A$21,$A$23+1,"M"))
But there was a reason for using this logic: if "Weeks" or "Days" are selected, there was previously a desire expressed to not show months and to report in terms of WD or D.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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