I want to calculate no of days in adjacent cell with following condition for the period of 10 years

(If day of month is 4th
Then count no. of days from last 21st to 4th ………. “no of days varies from 12 to 15”
If day of month is 20th
Then count no. of days from last 5th to 20th ……… “no of days are 16”
Else
Null)

Dates are in the following format

1-Jan-17
2-Jan-17
3-Jan-17
4-Jan-17 15 Days
5-Jan-17
6-Jan-17
.
.
20-Jan-17 16 Days
.
.
29-Dec-26
30-Dec-26
31-Dec-26


Regards,

Sandesh