Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Average depending on criteria

Status
Not open for further replies.

jh3016

Programmer
Jun 6, 2003
148
0
0
US
I would like to return an average:

If Column A = "Jan-04"

I need to have the average of how many times "Jan-04" appears in column A

Thanks in advance.
 
you could use a countif formula which will tell you how many time "Jan-04" appeared in that column.

try this
=COUNTIF(A:A,"Jan-04")
 
You really need to define what you are averaging against. is it the average of all the non blank cells, in which case something like

=COUNTIF(A:A,"Jan-04")/COUNTA(A:A)

and format as %

Regards
Ken................

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]

----------------------------------------------------------------------------
 
Look in the help on the DAVERAGE() function...
(There are a few more Dfunctions() as well)

If your data is in cells A1:C15

Name Sales Date
Smith 10 1/11/2004
Jones 20 1/12/2004
Miller 5 1/13/2004
Johnson 2 1/14/2004
Smith 5 1/15/2004
Jones 8 1/11/2004
Smith 20 1/12/2004
Johnson 12 1/13/2004
Smith 15 1/14/2004
Smith 6 1/15/2004
Miller 22 1/11/2004
Johnson 11 1/13/2004
Smith 9 1/15/2004
Jones 3 1/17/2004

then in cells(A18:C19)...type this, note: (this criteria definition can be typed any where), I just selected a18:c19
...here is where you can change the search criteria on the fly.

Name Sales Date
Smith >1/13/04

then to average the sales of Smith that occured after 1/13/04, the formula in a cell of your choice

=DAVERAGE(A1:C15,"Sales",A18:C19)


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top