View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
[email protected] robotman@gmail.com is offline
external usenet poster
 
Posts: 73
Default Conditional Average

How can I use a formula to average values in rows which have a certain
value in another column of that same row?

For example, I want to average the values in Col A if Col D = "A":

A B C D
1 12 1234 1234 A
2 11 1232 1654 A
3 40 2312 5435 B


This is what I tried (entered as an array with CTRL-SHIFT-ENTER), but
I get a #VALUE error:
=AVERAGE(IF(D2:D5000="A",A2:A5000,""))

The answer I'd be looking for is 11.5.

Any ideas?

Thanks.

John