Wednesday, May 07, 2014

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:
=AVERAGEIF($A$1:$A:$1234,A1,$B$1:$B$1234)

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

No comments :

Post a Comment