Is rolling up summary values based on dates - is there an easier way to do this?

I’m trying to wrap my head around your fomulars in:

However I for some reason can’t see how I can modify it to work with my Years and Months rather than Months and Days?