Joe Manausa
Joe Manausa

Reputation: 25

How to determine averages by multiple criteria including ignoring zeros in the calculations

I'm trying to create an averageifs statement that will go through a dataset and for each month, calculate the average (ignoring zero values) of two different columns). I'm not sure how to add a sample dataset to this question?

=averageifs(b:b, ">0", c:c, "Fresh") ... yields "you've entered too few arguments for this function."

also tried: =averageifs(b:b, ">0", a:a, e2, c:c, f1) ... same result

One can be downloaded from here: https://image-files-manausa.s3.us-west-2.amazonaws.com/Stack_Overflow_Example.xlsx

A screen capture is below:

enter image description here

Upvotes: 0

Views: 57

Answers (2)

Joe Manausa
Joe Manausa

Reputation: 25

I added a few named ranges to keep my head from spinning. This is a working solution:

=IFERROR(AVERAGEIFS(Time,Time,">0",Dates,">="&E2,Dates,"<="&EDATE(E2,1),Type,$F$1),"")

Where Dates is a2:a35 Time is b2:b35 Type is c2:c35

Upvotes: 0

Solar Mike
Solar Mike

Reputation: 8385

Just to show 3 ways of setting criteria in averageifs() or any of the xxxifs() functions:

enter image description here

I use the 3rd version where a cell is referenced as that is the most flexible.

Upvotes: 1

Related Questions