You need to define precisely what rules need to apply for the time periods and then fine tune how you use the intnx function to determine the low and high dates. If you'd rather make it be 180 days +/-, then change the first argument to 'day' and the third to +/- 180. There are probably a number of different date intervals and options ('B' or 'E', for example) to get what you want, but start with a clear and non-arbitrary rule for how you want to set the date ranges. I did read your examples, but I'm knocking this out with a few spare minutes I have and I wasn't able to easily interpret it into a clear rule. If you can do that, I or someone else here can surely help you get what you want.
... View more