View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default applying function depending on condition in other cell

Try:

Assumes data is in range a1 to b10

=Sumif(a1:a10,"x",b1:b10)/countif(a1:a10,"x")

HTH

" wrote:

Hi experts,

If I have data like this

A B
-------------
x 2
x 5
y 6
x 1
y 2
x 3

How do I include the values of column B in a function, only if the
values have a corresponding x in the A column. For example if I would
like to calculate the AVERAGE only of the values in B which has the
value X in A.

Jonas