Averaging

L

Leslie

Hi,

I need help with averaging a column of numbers.

I have two columns of numbers. I want to find the average of the
numbers in the first column that correspond to the numbers in the
second column that are greater than 0.

3 -2
4 6
6 9
7 0

So in this case the answer would be 5. The only two numbers in the
first column that correspond to numbers greater than zero in the
second column are the 6 and the 4. The average of 6 and 4 is 5.

Thanks,

Leslie
 
D

Dave Peterson

One way:

=SUMIF(B1:B4,">"&0,A1:A4)/COUNTIF(B1:B4,">"&0)

Or to avoid possible errors:

=IF(COUNTIF(B1:B4,">"&0)=0,"No matches",
SUMIF(B1:B4,">"&0,A1:A4)/COUNTIF(B1:B4,">"&0))
 
G

Guest

Another way, which needs to be confirmed with CTRL+SHIFT+ENTER

=AVERAGE(IF(B1:B4>0,A1:A4))
 

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

Similar Threads

Average Question 2
Averageif? 2
averaging numbers 5
CountIf Question 8
Intersection Problem 4
Averaging 5
Calculating Entropy 1
Counting Question 7

Top