Average

T

Troy

A B C
Jan-01 340 1
Jan-15 210 1
May-04 130 5
May-25 222 5
Aug-17 434 8
Aug-19 110 8

Column A is the date, Column B is the amount to be
averaged, Column C is the numeric month for Column A.
I need to get an average in a range, but only average (for
example) just month 5.
 
R

Ron Rosenfeld

A B C
Jan-01 340 1
Jan-15 210 1
May-04 130 5
May-25 222 5
Aug-17 434 8
Aug-19 110 8

Column A is the date, Column B is the amount to be
averaged, Column C is the numeric month for Column A.
I need to get an average in a range, but only average (for
example) just month 5.


=SUMIF(C1:C6,5,B1:B6)/COUNTIF(C1:C6,5)


--ron
 
T

Troy

This does work, but now my only problem is when I have
some months that don't have any values it gives me a
#DIV/0!

Is there any way to fix that?
 
T

Ture Magnusson

This should help!

=IF(COUNTIF(C1:C6,5)=0,0,SUMIF(C1:C6,5,B1:B6)/COUNTIF(C1:C6,5))
 
T

Troy

Yes, I figured it out, only difference is I put ),"") at
the end. Thanks for your help.
 
Top