OK, here goes.
I have set up the formulas with the first person in the list’s name in A2 and the year 2002 in B1.
Across column B, after the first person’s name, I have the listed data of whether they paid or not, just like in your example.
Below that, in rows 3, 4, 5, 6, and 7 I have created formulas that will drive this thing. You will need to enter the second person in the list in row 8, and then have 5 more dummy rows below that, etc. If you need formulas to just have the data on one tab, and then use another tab to bring over the data into the rows spaced out, that’s no problem, I can give it later.
Here are the formulas that will go into the rows, each one starting in Column B, and being dragged across under all of the years (using years 2002 through 2011, that means columns B through K, just like your example) - Row 4 is the only exception as it has 1 formula in cell B4, and a different formula for the rest of the row.
*These formulas are written into the first (leftmost cell) and then “dragged” across - that is, you grab the corner of the cell and literally drag it with your mouse cursor to populate the cells to its right.
Row 3: (cell B3 through K3): =IF(B2<>0,1,0)
Row 4: (in cell B4): =B3
(in cell C4 through K4): =IF(AND(B3=0,C3=1,1),1,0)
Row 5: (in cell B5 through K5): =SUM($B$4:B4)
Row 6: (in cell B6 through K6): =IF(OR(C5-B5=1,C5=0),1,0)
Row 7: (in cell B7 through K7): =SUM($B$6:B6)
After you do that, in columns M through R, we’re goign to set up the rest of the formulas.
In Row 1, we’re going to add some labels. We don’t to repeat these for addition customers, they are headers kind of like the years 2002-2011 and other stuff in Row 1.
In M1 through Q1, put the numbers 1, 2, 3, 4, and 5 - in order. So, put 1 in M1, 2 in N1, etc.
In cell R1, put the word Periods - this is just a label, but it’s handy.
In rows 3 through 7, we are going to have more formulas. These will also be “dragged” - in this case, they will all be entered into Column M and then dragged across through Column Q.
Row 3: =MATCH(M$1,$B5:$K5,0)
Row 4: =2001+M3
Row 5: =MATCH(M$1,$B7:$K7,0)
Row 6: =2001+M5
Row 7: =IF(M6=M4,"in "&M4,“from “&M4&”-”&M6)
Now, just 2 more formulas.
In cell R3: =COUNT(M3:Q3)
And the big one, in cell R7:
="Thank you so much for your previous support. According to our records, in the last ten years, you have been a paid member “&IF(R3=1,M7,IF(R3=2,M7&” and “&N7,IF(R3=3,M7&”, “&N7&”, and “&O7,IF(R3=4,M7&”, “&N7&”, “&O7&”, and “&P7,M7&”, “&N7&”, “&O7&”, “&P7&”, and "&Q7))))
Just put your data for the next customer in Row 8, and then select all of the cells from A3 through R7 and copy and paste that starting in A9. Rinse and repeat.
The formula in R7 (and similar) will return the following type of statement:
Thank you so much for your previous support. According to our records, in the last ten years, you have been a paid member from 2002-2005, from 2006-2008, and from 2009-2011
Hope this works for you.