ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   AVERAGE(IF()) problem (https://www.excelbanter.com/excel-worksheet-functions/54915-average-if-problem.html)

J

AVERAGE(IF()) problem
 
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

Biff

AVERAGE(IF()) problem
 
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

"J" wrote in message
...
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





All times are GMT +1. The time now is 01:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com