View Single Post
  #4   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Wed, 28 Sep 2005 01:17:00 +0100, amerkarim
wrote:


Hi Guys,

This is probably really easy but I have been struggling to average the
values in 2 linked collumns.

eg

A B
2 3
2 4
2 3
3 2
3 2
4 1
5 2
5 3

What I want to happen is it to calculate the average of the values in
the second column that match the same variable in the first column, and
paste them into a seperate row, so the formula would calculate
A B
2 (Average(3+4+3))
3 (Average(2+2))
4 1
5 (Average(2+3))

to produce these columns

A B
2 3.33
3 2
4 1
5 2.5

I have been trying to write a macro but with no luck.

Please help.

Many thanks in advance for looking.

Amer Karim


Ensure the two columns have labels at the top as in your example (A & B)
Select some cell in your table.
Data/Subtotals
At each change in "A"
Use function "Average"
Add subtotal to "B"

If need be, you can easily shift the cells over


--ron