I think it should be doable, but I made many assumptions on how your
true data was laid out. Would be grateful if you could post a sample
of fake data arranged as it will be in your true datasource.
I pivoted all the months into row, and then fixed the maxmonth
and minmonth values to the RowID so that the subtraction could take place.
Please see workbook v10.3 attached in the Forum Thread.