Here's a quick Excel trick for averaging duplicate values. It's the kind of simple command that I probably should have learned years ago, but it's only been available since Excel 2007 so at least there's that excuse.

Anyway, it's the AVERAGEIF function, used as follows:
=AVERAGEIF(the column with the duplicate values, a single value to get the corresponding average for, the column with the values to be averaged)
formatted so the first and last columns are static, like this:

I'm certain that something very similar can be done in a shell script based around uniq.