Spreadsheet: 44739d1243507391-too-many-arguments-error-help-need-to-clean-up-formula-calendartest
Sheet: Rate Sheet

Start Date | Period | Rate Category | Rate per night | [NAME] | [NAME] |  |  | Rates | Zone 1 |  | Rates | Zone 4 |  |  |  |  | Adults | 0
2009-08-01 00:00:00 | Zone 1 | Weekend | 230 | 0 | - |  |  | Weekday rate | 180 |  | Weekday Rate | 200 |  |  |  |  | Children | 0
2009-08-02 00:00:00 | Zone 1 | Weekend | 230 | 0 | - |  |  | Child Rate | 25 |  | Child Rate | 25 |  |  |  |  | [NAME] | 2009-08-11 00:00:00
2009-08-03 00:00:00 | Zone 1 | Mid-Week | 180 | 0 | - |  |  | [NAME] | 10 |  | [NAME] | 20 |  |  |  |  | Departure | 2009-08-14 00:00:00
2009-08-04 00:00:00 | Zone 1 | Mid-Week | 180 | 0 | - |  |  | Weekend Surcharge | 50 |  | Weekend Surcharge | 70 |  |  |  |  | Staying x nights | 3
2009-08-05 00:00:00 | Zone 1 | Mid-Week | 180 | 0 | - |  |  | 1 Night Surcharge | 100 |  | 1 Night Surcharge | 100 |  |  |  |  | Total Cost
2009-08-06 00:00:00 | Zone 1 | Mid-Week | 180 | 0 | - |  |  | 7 Day discount | 0.2 |  | 7 Day discount | 0.2 |  |  |  |  | Pre-total | 540
2009-08-07 00:00:00 | Zone 2 | Weekend | 240 | 0 | - |  |  | 6 Day discount | 0.15 |  | 6 Day discount | 0.15 |  |  |  |  | Breakfast Fee | 0
2009-08-08 00:00:00 | Zone 2 | Weekend | 240 | 0 | - |  |  | 5 Day discount | 0.1 |  | 5 Day discount | 0.1 |  |  |  |  | Zone | Zone 3
2009-08-09 00:00:00 | Zone 2 | Weekend | 240 | 0 | - |  |  | 4 Day discount | 0.05 |  | 4 Day discount | 0.05
2009-08-10 00:00:00 | Zone 2 | Mid-Week | 180 | 0 | -
2009-08-11 00:00:00 | Zone 3 | Mid-Week | 180 | 1 | BOOKING |  |  | Rates | Zone 2 |  | Rates | Zone 5
2009-08-12 00:00:00 | Zone 2 | Mid-Week | 180 | 1 | BOOKING |  |  | Weekday Rate | 180 |  | Weekday Rate | 220
2009-08-13 00:00:00 | Zone 2 | Mid-Week | 180 | 1 | BOOKING |  |  | Child Rate | 25 |  | Child Rate | 25
2009-08-14 00:00:00 | Zone 2 | Weekend | 240 | 0 | - |  |  | [NAME] | 30 |  | [NAME] | 40
2009-08-15 00:00:00 | Zone 3 | Weekend | 245 | 0 | - |  |  | Weekend Surcharge | 60 |  | Weekend Surcharge | 80
2009-08-16 00:00:00 | Zone 3 | Weekend | 245 | 0 | - |  |  | 1 Night Surcharge | 100 |  | 1 Night Surcharge | 100
2009-08-17 00:00:00 | Zone 3 | Mid-Week | 180 | 0 | - |  |  | 7 Day discount | 0.2 |  | 7 Day discount | 0.2 |  |  | Total cost or S6 is where I want this formula
2009-08-18 00:00:00 | Zone 3 | Mid-Week | 180 | 0 | - |  |  | 6 Day discount | 0.15 |  | 6 Day discount | 0.15 |  |  | IF(S5=4,S7-IF(S9=J1,J10,IF(S9=J12,J21,IF(S9=J23,J32,IF(S9=M1,M10,IF(S9=M12,M21,IF(S9=[NAME]=J1,J9,IF(S9=J12, J20,IF(S9=J23,J31,IF(S9=M1,M9,IF(S9=M12,M20,IF(S9=M23,M31,)))))), IF(S5=6,S7-(IF(S9=J1,J8,IF(S9=J12,J19,IF(S9=J23,J30,IF(S9=M1,M8,IF(S9=M12,M19,IF(S9=M23,M30,)))))))), IF(S5>=7,S7-(IF(S9=J1,J7,IF(S9=J12,J18,IF(S9=J23,J29,IF(S9=M1,M7,IF(S9=M12,M18,IF(S9=M23,M29,)))))))), 0)*S7
2009-08-19 00:00:00 | Zone 3 | Mid-Week | 180 | 0 | - |  |  | 5 Day discount | 0.1 |  | 5 Day discount | 0.1
2009-08-20 00:00:00 | Zone 3 | Mid-Week | 180 | 0 | - |  |  | 4 Day discount | 0.05 |  | 4 Day discount | 0.05
2009-08-21 00:00:00 | Zone 3 | Weekend | 245 | 0 | -
2009-08-22 00:00:00 | Zone 3 | Weekend | 245 | 0 | - |  |  | Rates | Zone 3 |  | Rates | Zone 6
2009-08-23 00:00:00 | zone 4 | Weekend | 270 | 0 | - |  |  | Weekday Rate | 180 |  | Weekday Rate
2009-08-24 00:00:00 | zone 4 | Mid-Week | 200 | 0 | - |  |  | Child Rate | 25 |  | Child Rate
2009-08-25 00:00:00 | zone 4 | Mid-Week | 200 | 0 | - |  |  | [NAME] | 50 |  | [NAME]
2009-08-26 00:00:00 | zone 4 | Mid-Week | 200 | 0 | - |  |  | Weekend Surcharge | 65 |  | Weekend Surcharge
2009-08-27 00:00:00 | zone 4 | Mid-Week | 200 | 0 | - |  |  | 1 Night Surcharge | 100 |  | 1 Night Surcharge
2009-08-28 00:00:00 | zone 5 | Weekend | 300 | 0 | - |  |  | 7 Day discount | 0.2 |  | 7 Day discount
2009-08-29 00:00:00 | Zone 5 | Weekend | 300 | 0 | - |  |  | 6 Day discount | 0.15 |  | 6 Day discount
2009-08-30 00:00:00 | zone 5 | Weekend | 300 | 0 | - |  |  | 5 Day discount | 0.1 |  | 5 Day discount
2009-08-31 00:00:00 | zone 5 | Mid-Week | 220 | 0 | - |  |  | 4 Day discount | 0.05 |  | 4 Day discount