'Tracking Count of Years and Months in Excel

This is a bit of a complicated question for excel, so I'll try to explain as best I can.

I'm trying to track membership time for each member in a group in the member list which is an excel sheet. Currently I have 2 columns, one for years and one for months which are both calculating the proper time based on the Join date of the members. My issue comes when trying to calculate for the subsection of members who have 'broken' membership time, meaning they left the group and rejoined some time later. To correct for that I have a second sheet that tracks the previous time for those members (also in columns of years and months) and I'm trying to add it to the first sheet. The formulas I have are below:

-To calculate the number of years since the member joined, then add any previous years from the PrevTime sheet, matching on column B which is Name on my primary sheet:

=DATEDIF(F2,TODAY(),"y") + INDEX(PrevTime!A:C, MATCH(B2,PrevTime!A:A,0), 2)

-To calculate the number of months since the member joined, then add any previous months from the PrevTime sheet, matching on column B which is Name on my primary sheet.

=DATEDIF(F2,TODAY(),"ym") + INDEX(PrevTime!A:C, MATCH(B2,PrevTime!A:A,0), 3)

Now, everything works fine with both these formulas, the issue comes when the member in question has some combination of current membership time months, and previous membership months that exceed 12. Then I end up with one less year for their membership time and more than 12 months for their membership months. (i.e. 2 years, 15 Months instead of 3 years, 3 months).

Was just hoping someone here might have an idea or any insight into things I could try to sort this out so the times are displayed nicely without overflowing the months past 12.

Thanks in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source