Can you AVERAGE IF and not null?

G

Guest

=AVERAGE(IF($A$3:$A$45="Photo",H3:H45))

This is the array I'm using to try to determine an average. Problem...if
the field is blank it's counting it as zero and lowering the results. It
figured 79% when it should have been 94%. 94% was returned using the simple
average formula. I'm guessing I need to nest something to not count nulls?
Help!!!

Spottkitty
 
J

JE McGimpsey

One way (array-entered: CTRL-SHIFT-ENTER or CMD-RETURN):

=AVERAGE(IF((A3:A45="Photo")*(H3:H45<>""),H3:H45))
 
H

Hijosdelongi

Hi,

I have a question for Excel 2003

=AVERAGE(IF(AND($A2=Data!$B:$B,B$1=Data!$A:$A),Data!$C:$C,""))

Im trying to get the AVERAGE of this and its giving me a #VALUE! error.. $A2
is the name that is suppose to be equal in the Data! worksheet and B$1 is the
date that is suppose to be equal in the Data! worksheet. Im trying to use AND
in IF for me to have two logical test..

Can you help me with this?

Thank you so much!
 
D

Dave Peterson

You can't use the entire column for array formulas in xl2003 and below.

(Remember to use ctrl-shift-enter, too)
 
T

T. Valko

I have a question for Excel 2003
=AVERAGE(IF(AND($A2=Data!$B:$B,B$1=Data!$A:$A),Data!$C:$C,""))

You can't use entire columns as range references in array formulas in Excel
2003. Use a smaller specific range.

Try it like this (array entered**)

=AVERAGE(IF((Data!A1:A10=B1)*(Data!B1:B10=A2),Data!C1:C10))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.
 
H

Hijosdelongi

EXCELENT! It worked!!! and how can I hide the #DIV/0! if there are still no
scores for that they..

Thank you :)
 
T

T. Valko

Try it like this:

Array entered.

=IF(ISERROR(AVERAGE(IF((Data!A1:A10=B1)*(Data!B1:B10=A2),Data!C1:C10))),"",AVERAGE(IF((Data!A1:A10=B1)*(Data!B1:B10=A2),Data!C1:C10)))
 
H

Hijosdelongi

Does ISERROR works in Excel 2003?

Thanks :)


T. Valko said:
Try it like this:

Array entered.

=IF(ISERROR(AVERAGE(IF((Data!A1:A10=B1)*(Data!B1:B10=A2),Data!C1:C10))),"",AVERAGE(IF((Data!A1:A10=B1)*(Data!B1:B10=A2),Data!C1:C10)))
 
H

Hijosdelongi

Hi,

I have a Question.. is VLOOKUP plus IF possible? This is my fomula..

=VLOOKUP(IF((Data!A1:A1000=A1)*(Data!B1:B1000=D1),....

is my logical tests or conditions correct? and how will i put the VLOOKUP
codes?

Can you help me with this..

THank you so much
 
K

klic33

My situation is similar but I haven't been able to customize this to work
like I thought I should be able to.
I have one cell in multiple tabs I that want to include in the average, as
long as they <>0. If anyone of them <>0, then I do not want that particular
cell to be factored into the result because it skews the average (because
it's a month that hasn't occured yet so the data is 0). Here's my
(nonworking) formula if anyone can help:

=average(if(jundata!b2,juldata!b2,augdata!b2,sepdata!b2,octdata!b2,novdata!b2,decdatab2<>""),jundata!b2,juldata!b2,augdata!b2,sepdata!b2,octdata!b2,novdata!b2,decdata!b2)
 
H

Hijosdelongi

Hi T. Valko,

How are you?

Got a Question again... im trying to get a data from the database using
VLOOKUP and why is that even though there is no value in the database it
still displays the 0 value?

And can you teach mo how to get a value from the database even though theres
no value in it?

ex.

A1 = "null value or no value"

how will display a value that is equivalent to a text or number even though
theres no value in the database?

Thank you.
 
T

T. Valko

Try this:

Create these named formulas...

Insert>Name>Define
Name: SumSheets
Refers to:

=SUMIF(INDIRECT(TEXT(30*{6,7,8,9,10,11,12},"mmm\data")&"!B2"),">0")

Name: CountSheets
Refers to:

=COUNTIF(INDIRECT(TEXT(30*{6,7,8,9,10,11,12},"mmm\data")&"!B2"),">0")

Then, you average formula is:

=SUMPRODUCT(SumSheets)/SUMPRODUCT(CountSheets)

Explanation:

Excel doesn't support *conditional* averaging across multiple sheets so we
need to trick it into doing so. We can't use the AVERAGE function in this
case. Since an average is the sum divided by the count that's what we're
doing with the above formula(s).

If you want to take the "easy" way out on this, on each sheet in the same
cell enter a formula like this:

=IF(B2>0,B2,"")

Let's assume those formulas are in cell B3. Then, you can use the AVAERAGE
function like this:

=AVERAGE(jundata:decdata!B3)
 
H

Hijosdelongi

hi Again,

Got a question again, is there any formula that can automatically erase or
remove an entire row if a specific cell doesnt have any value or an error
value to it???

ex.

I have this vlookup value in column E
=IF(ISERROR(VLOOKUP(A1:A5,Sheet1!B1:E100,3,FALSE)),"",VLOOKUP(A1:A5,Sheet1!B1:E100,3,FALSE)))

Is there anyway that i can delete or remove the entire row 4 if theres no
returned value or an error value???

A B C D E
1 x g e e sharon
2 x as vf v sharon
3 y g h j david
4 f b a r
5 p r e f dexter

Thank you..
 

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