OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

averageif function

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
warla
Newbie
Newbie


Joined: 18 Jun 2009
Posts: 1

PostPosted: Thu Jun 18, 2009 1:40 pm    Post subject: averageif function Reply with quote

Hi ... I have this range of data ...

Cat 2
Cat 3
Dog 5
Cat 2
Dog 3
Dog 2
Cat 2
Dog 2
Cat 3
Cat 2
Cat 1
Cat 3
Dog 2

The animal names are in one column and the second column is the number of that specific animal sold for that day. I just want to get the average of the rows in the 2nd column that have the word Cat in the 1st column. I've been playing around with averageif but can't get it to work. Sad

My formula is =averageif(D5:D17="Cat",E5:E17)

What's wrong with it? Thanks.
Back to top
View user's profile Send private message
David
Super User
Super User


Joined: 24 Oct 2003
Posts: 5668
Location: Canada

PostPosted: Thu Jun 18, 2009 6:17 pm    Post subject: Re: averageif function Reply with quote

warla wrote:

My formula is =averageif(D5:D17="Cat",E5:E17)

What's wrong with it?


Well, for one you seem to be making up your own functions. Not a bad idea if you did it it right, perhaps. Then, the quotations should surround and include the = sign. Then you use a semicolon separator in the first instance and a comma in the second.

I'd suggest that you do a little reading through the Help file. There you'll not see an AVERAGEIF() function to my knowledge. Then examine the syntax and examples for similar functions suggested below.

Suggestion: Try SUMIF() / COUNTIF()

Oh, what the heck ... =SUMIF(A1:A13;F1;B1:B13)/COUNTIF(A1:A13;F1) for example, where F1 contains Cat, or Dog, or whatever.

David.
Back to top
View user's profile Send private message
hotpepper
Power User
Power User


Joined: 04 Dec 2008
Posts: 52

PostPosted: Wed Jul 01, 2009 11:53 am    Post subject: Reply with quote

=AVERAGE(IF(D5:D17="Cat";E5:E17))

Confirm with SHIFT-CTRL-ENTER rather than just Enter
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group