Spreadsheet: 215674d1361454079-sick-pay-rolling-year-conundrum-book2
Sheet: Sheet1

No entitlement until: | See note in D1 |  | Cell B1 needs to show todays date unless the date in column B is greyed. In that case it needs to calculate the date at which the cell goes white again.
Date | [NAME]
2013-01-01 00:00:00 | S | Cell B1 would read: | RULES:
2013-01-02 00:00:00 | S | 2013-01-31 00:00:00 | Fred is entitled to 5 days paid sickness in any rolling 30 day period
2013-01-03 00:00:00 | S | 2013-01-31 00:00:00 | Once the period reaches 5 days the cells need to change colour for 30 days then revert to white
2013-01-04 00:00:00 | S | 2013-01-31 00:00:00
2013-01-05 00:00:00 | S | 2013-01-31 00:00:00
2013-01-06 00:00:00 |  | 2013-01-31 00:00:00
2013-01-07 00:00:00 |  | 2013-01-31 00:00:00 | SCENARIO:
2013-01-08 00:00:00 |  | 2013-01-31 00:00:00 | Fred is sick for 5 days iin january therefore has no further entitlement until 30 days after the start of the sick period
2013-01-09 00:00:00 |  | 2013-01-31 00:00:00 | Fred is sick again in mid-February, he has an entitlement (the cells are white) but, after the sick period has no entitelment until 30 days after the start of the sick period.
2013-01-10 00:00:00 |  | 2013-01-31 00:00:00
2013-01-11 00:00:00 |  | 2013-01-31 00:00:00
2013-01-12 00:00:00 |  | 2013-01-31 00:00:00
2013-01-13 00:00:00 |  | 2013-01-31 00:00:00
2013-01-14 00:00:00 |  | 2013-01-31 00:00:00
2013-01-15 00:00:00 |  | 2013-01-31 00:00:00
2013-01-16 00:00:00 |  | 2013-01-31 00:00:00
2013-01-17 00:00:00 |  | 2013-01-31 00:00:00
2013-01-18 00:00:00 |  | 2013-01-31 00:00:00
2013-01-19 00:00:00 |  | 2013-01-31 00:00:00
2013-01-20 00:00:00 |  | 2013-01-31 00:00:00
2013-01-21 00:00:00 |  | 2013-01-31 00:00:00
2013-01-22 00:00:00 |  | 2013-01-31 00:00:00
2013-01-23 00:00:00 |  | 2013-01-31 00:00:00
2013-01-24 00:00:00 |  | 2013-01-31 00:00:00
2013-01-25 00:00:00 |  | 2013-01-31 00:00:00
2013-01-26 00:00:00 |  | 2013-01-31 00:00:00
2013-01-27 00:00:00 |  | 2013-01-31 00:00:00
2013-01-28 00:00:00 |  | 2013-01-31 00:00:00
2013-01-29 00:00:00 |  | 2013-01-31 00:00:00
2013-01-30 00:00:00 |  | 2013-01-31 00:00:00
2013-01-31 00:00:00 |  | 2013-01-31 00:00:00
2013-02-01 00:00:00 |  | 2013-02-01 00:00:00
2013-02-02 00:00:00 |  | 2013-02-02 00:00:00
2013-02-03 00:00:00 |  | 2013-02-03 00:00:00
2013-02-04 00:00:00 |  | 2013-02-04 00:00:00
2013-02-05 00:00:00 |  | 2013-02-05 00:00:00
2013-02-06 00:00:00 |  | 2013-02-06 00:00:00
2013-02-07 00:00:00 |  | 2013-02-07 00:00:00
2013-02-08 00:00:00 |  | 2013-02-08 00:00:00
2013-02-09 00:00:00 |  | 2013-02-09 00:00:00
2013-02-10 00:00:00 |  | 2013-02-10 00:00:00
2013-02-11 00:00:00 |  | 2013-02-11 00:00:00
2013-02-12 00:00:00 |  | 2013-02-12 00:00:00
2013-02-13 00:00:00 |  | 2013-02-13 00:00:00
2013-02-14 00:00:00 |  | 2013-02-14 00:00:00
2013-02-15 00:00:00 |  | 2013-02-15 00:00:00
2013-02-16 00:00:00 |  | 2013-02-16 00:00:00
2013-02-17 00:00:00 |  | 2013-02-17 00:00:00
2013-02-18 00:00:00 |  | 2013-02-18 00:00:00
2013-02-19 00:00:00 |  | 2013-02-19 00:00:00
2013-02-20 00:00:00 |  | 2013-02-20 00:00:00
2013-02-21 00:00:00 |  | 2013-02-21 00:00:00
2013-02-22 00:00:00 |  | 2013-02-22 00:00:00
2013-02-23 00:00:00 | S | 2013-03-25 00:00:00
2013-02-24 00:00:00 | S | 2013-03-25 00:00:00
2013-02-25 00:00:00 | S | 2013-03-25 00:00:00
2013-02-26 00:00:00 | S | 2013-03-25 00:00:00
2013-02-27 00:00:00 | S | 2013-03-25 00:00:00
2013-02-28 00:00:00 |  | 2013-03-25 00:00:00
2013-03-01 00:00:00 |  | 2013-03-25 00:00:00
2013-03-02 00:00:00 |  | 2013-03-25 00:00:00
2013-03-03 00:00:00 |  | 2013-03-25 00:00:00
2013-03-04 00:00:00 |  | 2013-03-25 00:00:00
2013-03-05 00:00:00 |  | 2013-03-25 00:00:00
2013-03-06 00:00:00 |  | 2013-03-25 00:00:00
2013-03-07 00:00:00 |  | 2013-03-25 00:00:00
2013-03-08 00:00:00 |  | 2013-03-25 00:00:00
2013-03-09 00:00:00 |  | 2013-03-25 00:00:00
2013-03-10 00:00:00 |  | 2013-03-25 00:00:00
2013-03-11 00:00:00 |  | 2013-03-25 00:00:00
2013-03-12 00:00:00 |  | 2013-03-25 00:00:00
2013-03-13 00:00:00 |  | 2013-03-25 00:00:00
2013-03-14 00:00:00 |  | 2013-03-25 00:00:00
2013-03-15 00:00:00 |  | 2013-03-25 00:00:00
2013-03-16 00:00:00 |  | 2013-03-25 00:00:00
2013-03-17 00:00:00 |  | 2013-03-25 00:00:00
2013-03-18 00:00:00 |  | 2013-03-25 00:00:00
2013-03-19 00:00:00 |  | 2013-03-25 00:00:00
2013-03-20 00:00:00 |  | 2013-03-25 00:00:00
2013-03-21 00:00:00 |  | 2013-03-25 00:00:00
2013-03-22 00:00:00 |  | 2013-03-25 00:00:00
2013-03-23 00:00:00 |  | 2013-03-25 00:00:00
2013-03-24 00:00:00 |  | 2013-03-25 00:00:00
2013-03-25 00:00:00 |  | 2013-03-25 00:00:00
2013-03-26 00:00:00 |  | 2013-03-26 00:00:00
2013-03-27 00:00:00 |  | 2013-03-27 00:00:00
2013-03-28 00:00:00 |  | 2013-03-28 00:00:00
2013-03-29 00:00:00 |  | 2013-03-29 00:00:00
2013-03-30 00:00:00 |  | 2013-03-30 00:00:00
2013-03-31 00:00:00 |  | 2013-03-31 00:00:00
2013-04-01 00:00:00 |  | 2013-04-01 00:00:00
2013-04-02 00:00:00 |  | 2013-04-02 00:00:00
2013-04-03 00:00:00 |  | 2013-04-03 00:00:00
2013-04-04 00:00:00 |  | 2013-04-04 00:00:00
2013-04-05 00:00:00 |  | 2013-04-05 00:00:00
2013-04-06 00:00:00 |  | 2013-04-06 00:00:00
2013-04-07 00:00:00 |  | 2013-04-07 00:00:00
2013-04-08 00:00:00 |  | 2013-04-08 00:00:00
2013-04-09 00:00:00 |  | 2013-04-09 00:00:00
2013-04-10 00:00:00 |  | 2013-04-10 00:00:00
2013-04-11 00:00:00 |  | 2013-04-11 00:00:00
2013-04-12 00:00:00 |  | 2013-04-12 00:00:00
2013-04-13 00:00:00 |  | 2013-04-13 00:00:00
2013-04-14 00:00:00 |  | 2013-04-14 00:00:00
2013-04-15 00:00:00 |  | 2013-04-15 00:00:00
2013-04-16 00:00:00 |  | 2013-04-16 00:00:00
2013-04-17 00:00:00 |  | 2013-04-17 00:00:00
2013-04-18 00:00:00 |  | 2013-04-18 00:00:00
2013-04-19 00:00:00 |  | 2013-04-19 00:00:00
2013-04-20 00:00:00 |  | 2013-04-20 00:00:00
2013-04-21 00:00:00 |  | 2013-04-21 00:00:00
2013-04-22 00:00:00 |  | 2013-04-22 00:00:00
2013-04-23 00:00:00 |  | 2013-04-23 00:00:00
2013-04-24 00:00:00 |  | 2013-04-24 00:00:00
2013-04-25 00:00:00 |  | 2013-04-25 00:00:00
2013-04-26 00:00:00 |  | 2013-04-26 00:00:00
2013-04-27 00:00:00 |  | 2013-04-27 00:00:00
2013-04-28 00:00:00 |  | 2013-04-28 00:00:00
2013-04-29 00:00:00 |  | 2013-04-29 00:00:00
2013-04-30 00:00:00 |  | 2013-04-30 00:00:00
2013-05-01 00:00:00 |  | 2013-05-01 00:00:00
2013-05-02 00:00:00 |  | 2013-05-02 00:00:00
2013-05-03 00:00:00 |  | 2013-05-03 00:00:00
2013-05-04 00:00:00 |  | 2013-05-04 00:00:00
2013-05-05 00:00:00 |  | 2013-05-05 00:00:00
2013-05-06 00:00:00 |  | 2013-05-06 00:00:00
2013-05-07 00:00:00 |  | 2013-05-07 00:00:00
2013-05-08 00:00:00 |  | 2013-05-08 00:00:00
2013-05-09 00:00:00 |  | 2013-05-09 00:00:00
2013-05-10 00:00:00 |  | 2013-05-10 00:00:00
2013-05-11 00:00:00 |  | 2013-05-11 00:00:00
2013-05-12 00:00:00 |  | 2013-05-12 00:00:00
2013-05-13 00:00:00 |  | 2013-05-13 00:00:00
2013-05-14 00:00:00 |  | 2013-05-14 00:00:00
2013-05-15 00:00:00 |  | 2013-05-15 00:00:00
2013-05-16 00:00:00 |  | 2013-05-16 00:00:00
2013-05-17 00:00:00 |  | 2013-05-17 00:00:00
2013-05-18 00:00:00 |  | 2013-05-18 00:00:00
2013-05-19 00:00:00 |  | 2013-05-19 00:00:00
2013-05-20 00:00:00 |  | 2013-05-20 00:00:00
2013-05-21 00:00:00 |  | 2013-05-21 00:00:00
2013-05-22 00:00:00 |  | 2013-05-22 00:00:00
2013-05-23 00:00:00 |  | 2013-05-23 00:00:00
2013-05-24 00:00:00 |  | 2013-05-24 00:00:00
2013-05-25 00:00:00 |  | 2013-05-25 00:00:00
2013-05-26 00:00:00 |  | 2013-05-26 00:00:00
2013-05-27 00:00:00 |  | 2013-05-27 00:00:00
2013-05-28 00:00:00 |  | 2013-05-28 00:00:00
2013-05-29 00:00:00 |  | 2013-05-29 00:00:00
2013-05-30 00:00:00 |  | 2013-05-30 00:00:00
2013-05-31 00:00:00 |  | 2013-05-31 00:00:00
2013-06-01 00:00:00 |  | 2013-06-01 00:00:00
2013-06-02 00:00:00 |  | 2013-06-02 00:00:00
2013-06-03 00:00:00 |  | 2013-06-03 00:00:00
2013-06-04 00:00:00 |  | 2013-06-04 00:00:00