View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Zilla[_2_] Zilla[_2_] is offline
external usenet poster
 
Posts: 51
Default How to write this function?

Say I have the following

A B
1 2 10
2 4 5
3 2 20
4 2 30
5 4 11

How can I write a func. so if the cell values are equal,
for A col, it will add the values in corresponding B col,
then average the value out?

avg = SUM / #occur

So in may example, A1,A3 and A5 are all 2's so...
avg = 60 / 3 = 20

Again, A2 and A5 are both 4's so...
avg = 16 / 2 = 8

Thanks!

--
- Zilla
(Remove XSPAM)