Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Can you AVERAGE IF and not null?

196 views
Skip to first unread message

JE McGimpsey

unread,
May 5, 2005, 6:07:16 PM5/5/05
to
One way (array-entered: CTRL-SHIFT-ENTER or CMD-RETURN):

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

In article <32A8DE13-A9BB-4B60...@microsoft.com>,
"Spottkitty" <Spott...@discussions.microsoft.com> wrote:

> =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!!!

Hijosdelongi

unread,
Jul 4, 2009, 5:25:01 PM7/4/09
to

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!

Dave Peterson

unread,
Jul 4, 2009, 5:34:00 PM7/4/09
to

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

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

--

Dave Peterson

T. Valko

unread,
Jul 4, 2009, 5:48:21 PM7/4/09
to

>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.

--
Biff
Microsoft Excel MVP


"Hijosdelongi" <Hijosd...@discussions.microsoft.com> wrote in message
news:1567382F-DBDE-48B7...@microsoft.com...

Hijosdelongi

unread,
Jul 4, 2009, 5:52:01 PM7/4/09
to

ic, but is the =AVERAGE(IF(AND( correct?

Thanks

Hijosdelongi

unread,
Jul 4, 2009, 6:13:01 PM7/4/09
to
EXCELENT! It worked!!! and how can I hide the #DIV/0! if there are still no
scores for that they..

Thank you :)

T. Valko

unread,
Jul 4, 2009, 6:41:36 PM7/4/09
to

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)))

--
Biff
Microsoft Excel MVP


"Hijosdelongi" <Hijosd...@discussions.microsoft.com> wrote in message

news:7138297D-BAA3-4EB4...@microsoft.com...

Hijosdelongi

unread,
Jul 4, 2009, 6:54:01 PM7/4/09
to

Does ISERROR works in Excel 2003?

Thanks :)

Hijosdelongi

unread,
Jul 4, 2009, 7:45:00 PM7/4/09
to
I got the answer already, thank you so much!!!

=)

T. Valko

unread,
Jul 4, 2009, 10:09:22 PM7/4/09
to

You're welcome!

--
Biff
Microsoft Excel MVP


"Hijosdelongi" <Hijosd...@discussions.microsoft.com> wrote in message

news:DA647F5B-CA0E-4EE3...@microsoft.com...

Hijosdelongi

unread,
Jul 12, 2009, 10:31:02 PM7/12/09
to
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

klic33

unread,
Jul 14, 2009, 7:52:00 PM7/14/09
to
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)

T. Valko

unread,
Jul 14, 2009, 9:11:35 PM7/14/09
to
Will there ever be any negative numbers?

--
Biff
Microsoft Excel MVP


"klic33" <kli...@discussions.microsoft.com> wrote in message
news:F1C8F4B9-2F42-4520...@microsoft.com...

Hijosdelongi

unread,
Jul 15, 2009, 1:51:01 AM7/15/09
to
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. Valko

unread,
Jul 15, 2009, 1:56:19 AM7/15/09
to
You'll have to post the formula.

--
Biff
Microsoft Excel MVP


"Hijosdelongi" <Hijosd...@discussions.microsoft.com> wrote in message

news:C406F9A8-909D-4FFF...@microsoft.com...

klic33

unread,
Jul 15, 2009, 10:09:01 AM7/15/09
to
no, nothing less than zero

T. Valko

unread,
Jul 15, 2009, 2:40:48 PM7/15/09
to
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)

--
Biff
Microsoft Excel MVP


"klic33" <kli...@discussions.microsoft.com> wrote in message

news:1B9C9986-0850-49D0...@microsoft.com...

Hijosdelongi

unread,
Jul 23, 2009, 9:30:02 PM7/23/09
to
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..

T. Valko

unread,
Jul 24, 2009, 12:07:20 AM7/24/09
to
No, a formula can't do that. If you want it to be "semi-automatic" you'd
need a macro.

You can do it with a few clicks of a mouse...

Remove the error trap from your formula and let the errors generate.
Select column E
Goto the menu Edit>Go To>Special
Select: Formulas and uncheck everything *except* Errors
OK

That will select all the cells in col E that contain errors

Goto the menu Edit>Delete
Select: Entire Row
OK

--
Biff
Microsoft Excel MVP


"Hijosdelongi" <Hijosd...@discussions.microsoft.com> wrote in message

news:BBABF7B6-7DE8-410B...@microsoft.com...

Hijosdelongi

unread,
Jul 24, 2009, 2:11:02 AM7/24/09
to
ahh ok, thanks dude =)

T. Valko

unread,
Jul 24, 2009, 9:54:41 PM7/24/09
to
You're welcome!

--
Biff
Microsoft Excel MVP


"Hijosdelongi" <Hijosd...@discussions.microsoft.com> wrote in message

news:ED620B35-5B50-4C14...@microsoft.com...

Hijosdelongi

unread,
Aug 2, 2009, 7:39:01 AM8/2/09
to
Hi, got a Question again... is there any formula that can automatically
create a comment in a cell?

ex.

A1 = 80% and can we have a comment on that, that automatically that says
"Passed"

Thanks.

T. Valko

unread,
Aug 2, 2009, 11:25:39 AM8/2/09
to
Hmmm....

I'm not sure. You might be able to do that with an event macro but I don't
know how to do it.

Try posting this question in the programming forum. If A1 contains a formula
make sure you note that in your question.

--
Biff
Microsoft Excel MVP


"Hijosdelongi" <Hijosd...@discussions.microsoft.com> wrote in message

news:2EDCB8D1-D607-4594...@microsoft.com...

Hijosdelongi

unread,
Aug 3, 2009, 11:44:01 PM8/3/09
to
ahh ok, thank you so much.. and do happen to know where can go i that forum?
do u know the link to that furom? thanks. =)

T. Valko

unread,
Aug 4, 2009, 12:35:15 AM8/4/09
to
I see that you're using the MS web interface so in the list on the left side
select Excel Programming.

--
Biff
Microsoft Excel MVP


"Hijosdelongi" <Hijosd...@discussions.microsoft.com> wrote in message

news:1850E3D4-C17C-4CE8...@microsoft.com...

Hijosdelongi

unread,
Aug 22, 2009, 1:38:01 AM8/22/09
to
Hi, need some help again..

I have this project and i'm calculating the average of my students..

I have this table..

A B C

1 Mike 60 ?

2 Jorge 70 ?

3 Stan 65 ?

I would like to ask whats the formula to calculate how much more a student
needs to have for him/her to get 72? 72 is the passing score, and i would
like to ask how much he needs to reach 72. Possible score for a student to
have is between 0-100.

Thanks for you usual help.

hijosdelongi

Hijosdelongi

unread,
Aug 22, 2009, 1:54:01 AM8/22/09
to
Hi, need some help again..

I have this project and i'm calculating the average of my students..

I have this table..

A B C

1 Mike 60 ?

2 Jorge 70 ?

3 Stan 65 ?

I would like to ask whats the formula to calculate how much more a student
needs to have for him/her to get 72? 72 is the passing score, and i would
like to ask how much he needs to reach 72. Possible score for a student to
have is between 0-100.

Thanks for you usual help.

hijosdelongi

T. Valko

unread,
Aug 22, 2009, 2:14:07 AM8/22/09
to
Try this:

=IF(B1>=72,"",72-B1)

Copy down as needed.

--
Biff
Microsoft Excel MVP


"Hijosdelongi" <Hijosd...@discussions.microsoft.com> wrote in message

news:8931F575-53EA-403E...@microsoft.com...

Hijosdelongi

unread,
Aug 25, 2009, 8:48:07 AM8/25/09
to
This actually works but is there any way it can calculate how many more 100's
a student needs to have for him/her to reach 72..?

ex,

jorge alrealy has an average of 70 out of 12 exams, so how many more 100's
he needs to get for him to get a 72+ average..


Thank you.

hijosdelongi

T. Valko

unread,
Aug 25, 2009, 12:22:39 PM8/25/09
to
Sorry, I'm not sure I know how to do that.

--
Biff
Microsoft Excel MVP


"Hijosdelongi" <Hijosd...@discussions.microsoft.com> wrote in message

news:2A900A9E-9D89-4C06...@microsoft.com...

Hijosdelongi

unread,
Aug 26, 2009, 1:01:01 PM8/26/09
to
no problem dude, youve been so much help.. thank you. =)

Hijosdelongi

unread,
Aug 28, 2009, 10:42:01 AM8/28/09
to
Hi, its me again..

If ever you find the answer to my last Question, please do message me..
thank you so much!

hijosdelongi

Hijosdelongi

unread,
Sep 14, 2009, 9:31:01 PM9/14/09
to
Hi Again,

Got a question again.. How can i count text or words?

Ex.

in column A, i got texts that is equal to "Very Satisfied" and "Satisfied"
and others.

A
Very Satisfied
Satisfied
Not Satisfied
Very Satisfied
Very Satisfied
Satisfied

How can i count the cells that contains "Very Satisfied"? and is there any
way for me to get the Average of "Very Satisfied" against the total number of
data that is in column A

thank you. :)

T. Valko

unread,
Sep 14, 2009, 10:45:26 PM9/14/09
to
For the count:

Data in the range A2:A7...

C2 = satisified

=COUNTIF(A2:A7,C2)

For the percentage:

Assuming the count formula is in D2...

=D2/COUNTA(A2:A7)

Format as Percentage

--
Biff
Microsoft Excel MVP


"Hijosdelongi" <Hijosd...@discussions.microsoft.com> wrote in message

news:5EA840C2-03C1-43A9...@microsoft.com...

Hijosdelongi

unread,
Sep 15, 2009, 12:55:01 AM9/15/09
to
Thank you so much for this.. A follow up question, im trying to get the
number and average of very satisfied comments of a lis of students..

ex.

This is the Data Worksheet

A B
mike Very Satisfied
Kris Very Satisfied
Kris Satisfied
Mike Satisfied
Mike Very Satisfied
Mike Not Satisfied
Tamy Satisfied
Tamy Satisfied

and this is my formula :

This is a cell from a different Worksheet

D3 = Very Satisfied

=COUNT(IF((Data!A2:A100=B2)*(Data!B2:B100=C3),Data!B2:B100))

Thank you so much!

T. Valko

unread,
Sep 15, 2009, 4:25:59 PM9/15/09
to
>=COUNT(IF((Data!A2:A100=B2)*(Data!B2:B100=C3),Data!B2:B100))

Ok, I'm assuming you want the count of "very satisfied" for a particular
person.

=SUMPRODUCT(--(Data!A2:A100=B2),--(Data!B2:B100=C3))

If you're using Excel 2007:

=COUNTIFS(Data!A2:A100,B2,Data!B2:B100,C3)

I'm not sure about your average. *Exactly* what do you want to average?


--
Biff
Microsoft Excel MVP


"Hijosdelongi" <Hijosd...@discussions.microsoft.com> wrote in message

news:CD45A172-957E-4681...@microsoft.com...

Hijosdelongi

unread,
Sep 15, 2009, 5:36:09 PM9/15/09
to
for that i want to get the average of number of very satisfied rating versus
the non very satisfied rating of a single person..

ex.

for mike, he has 4 surveys and 2 out of 4 are very satisfied, so clearly its
50% right... thats what i mean for the average, i dont know how to formulate
that.

Thank you.

Hijosdelongi

unread,
Sep 15, 2009, 6:36:01 PM9/15/09
to
I got the average already, thanks to you... but is there any way that i can
put a date range on the formula? something like i can only count the number
of very satisfied ratings this september?

can this be possible?
=SUMPRODUCT(--(Data!A2:A100=B2),--(Data!B2:B100=C3),--(A1:A31=[Date.xls]Date!A1:A31))

is this possible?

Thank you.

T. Valko

unread,
Sep 15, 2009, 9:09:52 PM9/15/09
to
To include a date range..

Data!A2:A100 = names
Data!B2:B100 = response
Data!C2:C100 = dates

These are the criteria:

B2 = some name = Mike
C2 = some response = very satisfied
D2 = start date = 9/1/2009
E2 = end date = 9/30/2009

=SUMPRODUCT(--(Data!A2:A100=B2),--(Data!B2:B100=C2),--(Data!C2:C100>=D2),--(Data!C2:C100<=E2))

--
Biff
Microsoft Excel MVP


"Hijosdelongi" <Hijosd...@discussions.microsoft.com> wrote in message

news:75F48818-0374-4997...@microsoft.com...

Hijosdelongi

unread,
Sep 16, 2009, 2:16:01 PM9/16/09
to
Thank you so much! everything is working now. Cheers!

T. Valko

unread,
Sep 16, 2009, 4:15:32 PM9/16/09
to
You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Hijosdelongi" <Hijosd...@discussions.microsoft.com> wrote in message

news:C3B250F7-4A9E-472C...@microsoft.com...

Hijosdelongi

unread,
Mar 3, 2010, 3:40:01 AM3/3/10
to
Hi!

It's me again :)

I would like to ask for your help again..

How can i get the data from 1 worksheet to another?

Sheet 1

A B C
Date Name ACD
March 1 Mike 34
March 1 John 100
March 1 James 75
March 2 John 80


In Sheet 2

How can I lookup or display the data from sheet 1 to sheet to sheet 2?
ex. How can i display the ACD of John for March 1?

A B C
Date NAME ACD
March 1 John ?

What would be my formula in C3 for me to display the ACD of john for march 1?

Thank you so much for your help!

=)

Bob Phillips

unread,
Mar 3, 2010, 3:52:52 AM3/3/10
to
Try this array formula

=INDEX(Sheet1!$C:$C,MATCH(1,(Sheet1!$A$2:$A$200=A2)*(Sheet1!$B$2:$B$200=B2),0))


--

HTH

Bob

"Hijosdelongi" <Hijosd...@discussions.microsoft.com> wrote in message

news:84044DDD-7E10-4ED7...@microsoft.com...

Hijosdelongi

unread,
Mar 3, 2010, 5:31:01 AM3/3/10
to
Thanks a lot Bob, it worked great!

=)

"Bob Phillips" wrote:

> .
>

Hijosdelongi

unread,
Apr 25, 2010, 6:20:01 PM4/25/10
to
Hi There!

I Need your help again.

I have This

John VS 100
Mike VD -100
Mike VS 100
John VS 100
John VD -100
John S 0

I would like to compute the score of John, for him only

This is the Formula : ( VS + ( VD )) / Total number of Surveys

So its like this

(200 + ( -100 )) / 4


Thanks,

Hijosdelongi

T. Valko

unread,
Apr 25, 2010, 10:20:21 PM4/25/10
to
Try this...

=SUMPRODUCT(--(A2:A7="John"),--(ISNUMBER(MATCH(B2:B7,{"VS","VD"},0))),C2:C7)/COUNTIF(A2:A7,"John")

Better to use cells to hold the criteria.

E2 = John
F2 = VS
G2 = VD

=SUMPRODUCT(--(A2:A7=E2),--(ISNUMBER(MATCH(B2:B7,F2:G2,0))),C2:C7)/COUNTIF(A2:A7,E2)

--
Biff
Microsoft Excel MVP


"Hijosdelongi" <Hijosd...@discussions.microsoft.com> wrote in message

news:61C58123-09AF-417E...@microsoft.com...

Hijosdelongi

unread,
Apr 26, 2010, 2:49:01 AM4/26/10
to
THank you so much! :)


"T. Valko" wrote:

> .
>

Hijosdelongi

unread,
Apr 26, 2010, 3:09:01 PM4/26/10
to
Hi,

Why is that its giving me a 0 value?

The survey its actually like this :

VS = 100
S = 0
NS = 0
VD = -100
D = -100

So if John has

John VS
John VD
John D
John S
John NS
Mike D
Mike VS
Mike VS


the formula again is

(VS + ( D + VD ))/Total number of surveys


So its like this

(100 + ( -200 )) / 5

So the answer for this should be -20


Thanks again for your help :)


"T. Valko" wrote:

> .
>

T. Valko

unread,
Apr 26, 2010, 5:15:11 PM4/26/10
to
>The survey its actually like this

So, you have a separate table with the code values?

Ok, rearange your code table so that it's sorted in ascending order like
this:

D...-100
NS...0
S...0
VD...-100
VS...100

Assume that table is in the range A1:B5

Your list of names and codes is in the range D1:E8.

Array entered** :

=AVERAGE(IF(D1:D8="John",LOOKUP(E1:E8,A1:B5)))

** 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.

--
Biff
Microsoft Excel MVP


"Hijosdelongi" <Hijosd...@discussions.microsoft.com> wrote in message

news:751AD37A-6642-4E3D...@microsoft.com...

Hijosdelongi

unread,
Apr 26, 2010, 6:48:03 PM4/26/10
to
Thanks, let me try that :)

"T. Valko" wrote:

> .
>

0 new messages