View Single Post
 
Old 08-08-2012, 06:18 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Windows 7 32bit Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

Hi Rob,

Since you have more than one condition you have to use AVERAGEIFS instead of AVERAGEIF.
Code:
=AVERAGEIFS(E3:E100,C3:C100,MONTH(TODAY()),D3:D100,YEAR(TODAY()))
If you also want to exclude scores less than or equal to zero then include a third condition:
Code:
=AVERAGEIFS(E3:E100,C3:C100,MONTH(TODAY()),D3:D100,YEAR(TODAY()),E3:E100,">0")
You could simplify (and improve) things further by putting =TODAY() in a spare cell (eg cell H1) and then referecing it from your formula, such as
Code:
=AVERAGEIFS(E3:E100,C3:C100,MONTH(H1),D3:D100,YEAR(H1),E3:E100,">0")
Reply With Quote