You guys have been a great help in the past. Hopefully you can help me out with some problems I've been having.

I'm trying to average data for the past 3 years. My spreadsheet is setup like this.

Year, NameID, Salary, Average Salary

I have the spreadsheet sorted by NameID so most people in the database will have 3 entries right after another. How do I determine an average salary for the person across all 3 years?

I need the average salary to display across from the most recent date if that is possible as well i.e. if the latest salary date is from 2006, I would prefer that is entered into the row corresponding to 2006 and leave the 2004/2005 rows blank.

Also, some people might only have 2 years of data so keep that in mind as well.

I hope I'm clear with what I need and I'm really hoping you guys can help.

Thanks,

DrSues02