[Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register]

Author Message
warla
Newbie

Joined: 18 Jun 2009
Posts: 1

 Posted: Thu Jun 18, 2009 1:40 pm    Post subject: averageif function 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. My formula is =averageif(D5:D17="Cat",E5:E17) What's wrong with it? Thanks.
David
Super User

Joined: 24 Oct 2003
Posts: 5668

Posted: Thu Jun 18, 2009 6:17 pm    Post subject: Re: averageif function

 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.
hotpepper
Power User

Joined: 04 Dec 2008
Posts: 52

 Posted: Wed Jul 01, 2009 11:53 am    Post subject: =AVERAGE(IF(D5:D17="Cat";E5:E17)) Confirm with SHIFT-CTRL-ENTER rather than just Enter
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 8 Hours Page 1 of 1

 Jump to: Select a forum OpenOffice.org Forums----------------Setup and TroubleshootingOpenOffice.org WriterOpenOffice.org CalcOpenOffice.org ImpressOpenOffice.org DrawOpenOffice.org MathOpenOffice.org BaseOpenOffice.org Macros and APIOpenOffice.org Code Snippets Community Forums----------------General DiscussionSite Feedback
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