Need to use IF to AVERAGE 2 separate references

  • Thread starter Thread starter BLB
  • Start date Start date
B

BLB

I'm using the AVERAGE function to calculate the average of numbers, bu
excluding zeroes. The problem is that I am trying to calculate
separate references. Normally you would use a comma to separate the
references, but because the IF function uses the comma to separate it
arguments, this doesn't work. For example:

={AVERAGE(IF(A3:A5<>0),A3:A5)}

or the same formula NOT using the array formula would be:

=SUM(A3:A5)/COUNTIF(A3:A5,"<>0")

However, my problem is that I want to calculate the average betwee
A3:A5 and D3:D5. Do I need to use a nested IF? If so, how? Becaus
the following doesn't work:

={AVERAGE(IF(A3:A5,D3:D5<>0),A3:A5,D3:D5)} ---> obviously there ar
too many arguments in this formula. I tried the OR function, but i
doesn't return the correct answer. I also tried putting parenthasi
around just the 2 references
 
Never mind, I figured it out. It needs to be this:

=SUM(A3:A5)/SUM(COUNTIF(A3:A5,"<>0"),COUNTIF(D3:D5,"<>0"))


:cool
 

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

Array Formula - Average from every other cell 7
Average Formula 1
Average Formula Help 4
if statement 2
How to make Weighted Average 3
Copy a formula using Vlookup 2
How to use cell reference? 9
average formula? 8

Back
Top