Lil Stinker
Board Regular
- Joined
- Feb 16, 2022
- Messages
- 151
- Office Version
- 2019
- Platform
- Windows
The formula I have in the Subtotal column below doesn't quite work for what I need. What I'm looking for is when a user selects "Months" from the drop down in cell E1, I need the formula to begin prorating after a 30-day minimum period. I also need it to prorate when the user selects "Weeks", to start prorating after a 7-day minimum. This way, if they are taking equipment out for any period of time less than the required one month or one week minimum, the rate does not start prorating immediately.
What I currently have for the weekly IF formula sort of works but the math is off. As you can see in the example, $200*2*1.71 should equal $684 and $100*1.71 should equal $171 but somehow it is adding change from somewhere. The totals come out correct only when the period of time is an even number like 1 week or 2 weeks.
I'm pretty inept at putting together Excel formulas... please help!
What I currently have for the weekly IF formula sort of works but the math is off. As you can see in the example, $200*2*1.71 should equal $684 and $100*1.71 should equal $171 but somehow it is adding change from somewhere. The totals come out correct only when the period of time is an even number like 1 week or 2 weeks.
I'm pretty inept at putting together Excel formulas... please help!
ORDER FORM -formula tests- 2022.xlsx | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | |||
1 | Description | QTY | Unit Rate | Weeks | Item Subtotal | [ Term ] | |||||||||
2 | Pickup Date | MiFi Hotspot | 2 | 200.00 | 1.71 | $685.72 | Months | ||||||||
3 | 12/29/22 | MiFi Hotspot | 1 | 100.00 | 1.71 | $171.43 | Weeks | ||||||||
4 | Billing Start | ||||||||||||||
5 | 02/24/22 | ||||||||||||||
6 | Billing End | Months | Weeks | Days | Weekly Rate | Daily Rate | Subtotal | ||||||||
7 | 03/08/22 | 0.00 | 1.00 | 5.00 | 50.00 | 7.14 | 171.40 | ||||||||
8 | Return Date | 0.00 | 1.00 | 5.00 | 25.00 | 3.57 | 42.85 | ||||||||
9 | 04/01/22 | ||||||||||||||
10 | |||||||||||||||
11 | Subtotal | $857.15 | |||||||||||||
12 | Discount | $0.00 | |||||||||||||
13 | Net Amount | $857.15 | |||||||||||||
14 | TOTAL AMOUNT | $857.15 | |||||||||||||
Sheet2 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E2:E3 | E2 | =IF(E$1="Weeks",ROUNDDOWN((DATEDIF($A$5,$A$7,"d")/7),2),IF(OR($B2="",AND(E$1<>"Months")),"",SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(IF(E$1="Months",DATEDIF($A$5,$A$7,"m")&"m,"&INT(($A$7-EDATE($A$5,DATEDIF($A$5,$A$7,"m")))/7)&"w,"&MOD($A$7-EDATE($A$5,DATEDIF($A$5,$A$7,"m")),7)&"d",INT(($A$7-$A$5)/7)&"w,"&MOD($A$7-$A$5,7)&"d"),"0m,",""),"0w,",""),",0d",""))) |
F2 | F2 | =IF(ISBLANK(C2),"",IF(E$1="Months",(D2*H7+K7*I7+L7*J7)*C2,IF(E$1="Weeks",ROUNDUP((MAX(D2,DATEDIF($A5,$A7,"d")*D2/7)*C2),2)))) |
F3 | F3 | =IF(ISBLANK(C3),"",IF(E$1="Months",(D3*H8+K8*I8+L8*J8)*C3,IF(E$1="Weeks",ROUNDUP((MAX(D3,DATEDIF($A5,$A7,"d")*D3/7)*C3),2)))) |
H7:H14 | H7 | =IF(ISBLANK(C2),"",DATEDIF($A$5,$A$7,"M")) |
I7:I14 | I7 | =IF(ISBLANK(C2),"",INT(($A$7-EDATE($A$5,DATEDIF($A$5,$A$7,"m")))/7)) |
J7:J14 | J7 | =IF(ISBLANK(C2),"",MOD($A$7-EDATE($A$5,DATEDIF($A$5,$A$7,"m")),7)) |
K7:K14 | K7 | =IF(ISBLANK(C2),"",(ROUND(D2/4,2))) |
L7:L14 | L7 | =IF(ISBLANK(C2),"",(ROUND(K7/7,2))) |
M7:M14 | M7 | =IF(ISBLANK(C2),"",(D2*H7+K7*I7+L7*J7)*C2) |
F11 | F11 | =SUBTOTAL(109,Table22[Item Subtotal]) |
F13 | F13 | =(F11-(F11*F12)) |
F14 | F14 | =F13 |
Cells with Data Validation | ||
---|---|---|
Cell | Allow | Criteria |
E1 | List | =$H$1:$H$3 |