Average If Array Formula

M

Meteor1240

Hi. I have the following formula in my spreadsheet that I need some help with:

=ROUND(AVERAGE(IF((Damian!$N$4:$N$10000=""),Damian!$P$4:$P$10000)),0)

Cells N4 through N10000 contain either a blank cell or an E or an I. Cells
P4 through P10000 contain a calculated number. The array function states the
following:

If any cell within the range of N4 through N10000 on the worksheet named
Damian are blank
then find the average of the corresponding cells within the range of P4
through P10000
and round to the zero digit

I have a similar function (see below) in another cell to find all cells in
N4 through N10000 that are not blank. This formula works fine.

=ROUND(AVERAGE(IF((Damian!$N$4:$N$10000<>""),Damian!$P$4:$P$10000)),0)

The formula for finding blank cells is returning a value of 0 when it should
return a value of 21. Any ideas of why this is not working?

Thanks!
 
B

Bob Phillips

Maybe there are some spaces in there. Try

=ROUND(AVERAGE(IF(TRIM(Damian!$N$4:$N$10000)="",Damian!$P$4:$P$10000)),0)



--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
M

Meteor1240

Forgot to mention that I am using the CTRL+SHFT+ENTER keys when entering
these formulas.
 
S

Sandy Mann

Meteor1240 said:
=ROUND(AVERAGE(IF((Damian!$N$4:$N$10000=""),Damian!$P$4:$P$10000)),0)

This will return 0's for all cells were N & P are empty, is it possible that
you have enough blank rows to reduce the average below 1?

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 

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