AVERAGE(IF()) problem

G

Guest

i have two columns and want to search through a column for X and take the
average of all the cells that are next to X. for example:

W .2
X .4
X .3
T .9

the desired result is that the cell will have the value of the average of
cells next to X: (.4+.3)/2 = .35

when i type in AVERAGE(IF(col1="X",col2)) i end up with an average of all
values in col2 which is not what i want. any ideas? thanks in advance
 
B

Biff

Hi!

That is an array formula and MUST be entered using the key combo of
CTRL,SHIFT,ENTER.

If done properly Excel will place squiggly braces { } around the formula:

{=AVERAGE(IF(A1:A4="X",B1:B4))}

You cannot just type the braces in, you MUST use the key combo.

Biff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top