I am working with this data in excel. here is the original data

input

person1     2007
person1     2008
person1     2008
person1     2011
person2     2005
person2     2008
person2     2009
person3     2011
person3     2012
person3     2012
person3     2014
person4     2015

ouput

person1     2007    0
person1     2008    1   
person1     2008    0
person1     2011    3

person2     2005    0
person2     2008    3
person2     2009    1

person3     2011    0
person3     2012    1
person3     2012    0
person3     2014    2

person4     2015    0
I would like to use an excel function to find the year interval for the each person. I have shown my input file and output file. I can't think of anything right now, any ideas?

many thanks in advance.