Average only some values

A

Andreas

Hi

My workbook contains, amongs other, a column with values for the
temperature in a pipe, and three other columns with values indicating
the time three different machines has been on. I'd like to calculate
the average of all values in the first colum, but only the values
where any of the machine has been turned on.

For instance: The first colum contains the values {10,10,12,12,13},
the other contains the values (0,0,1,0,0), (1,0,0,0,0), (1,0,0,0,0).
Here the first average should be 11, because only the first and the
third value is of intrest.

How should I do that?
 
F

Frank Kabel

Hi
one way
=SUMPRODUCT(--(((B1:B5)+(C1:C5)+(D1:D5))>0),A1:A5)/SUMPRODUCT(--(((B1:B
5)+(C1:C5)+(D1:D5))>0))
 
L

Leo Heuser

Hi

Another option:

=AVERAGE(IF(B2:B6+C2:C6+D2:D6,A2:A6))

This is an array formula, and it must be entered with
<Shift><Ctrl><Enter> also if edited later. If done
correctly, Excel will display the formula in the formula
bar enclosed in curly brackets { }. Don't enter these
brackets yourself.
 

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