In the pivot table in the previous attachment I had guess-grouped the Term Periods into a field called Term Period2 as shown below:
2019-06-27_211701.jpg
All you need to do is redo the grouping or use Term Period instead of Term Period2 both in the pivot table and in the GetPivotData formulae.

Note also that I made a tweak to the formulae in column H of Sheet1:
=DATEDIF(D2,E2+1,"m")