UPDATED screenshot after attempting @Dude_Scott's suggestion:
Desired output of data is in the blue table.
Our data includes users who have registered between 1989-2016. All have registered at least once. Some register every year and some skip years. Our question is for each year, find how many years previous users registered. We want results to be 0yr, 1yr, 2yr, 3yr, etc., for each year. Arrays are working correctly.
I've organized the data structure in Excel this way:
1) UserID All Years
For year 1989, result is 0, since it was the first year of data collection.
For year 1990, this formula returns the expected count:
=COUNT(IF($B$2:$B$11613=1989,1/COUNTIFS($A$2:$A$11613,$A$2:$A$11613,$B$2:$B$11613,1989)))
Beginning with year 1991 is where I am tripped up: I can't find for multiple years. This formula is not working:
=COUNT(IF(AND(OR($B$2:$B$11613=1989,1990,1/COUNTIFS($A$2:$A$11613,$A$2:$A$11613,$B$2:$B$11613,1989,1990)))))
Where do I argue "COUNTIF 0 yr, 1 yr, 2 yr", etc. Thanks in advance. --f66
COUNTIFS()
? – BruceWayne