Averaging data over 5 years with Stata or Excel
Is this what you want (in Stata)?

 clear all
 * Generate Data (n=5, T=20)
 set obs 100
 gen id = floor((_n-1)/20)+1
 by id, sort: gen year = 1990+_n
 gen x = rnormal()
 xtset id year
 * Convert
 gen t5 = floor((year-1991)/5)+1
 gen idt5 = id*10+t5 /* 10 can be 100, 1000, etc., depending on T */
 by idt5, sort: egen xbar5 = mean(x)
 *drop t5 idt5  /* drop if you want; you can also use tempvar */


If not, please clarify your question using an example.