CreateMinMaxGroup function

Constructing the minimum and the maximum for a group of dates(phase)