Average values in date range

S

sarahg

Hi

I have a list of numerical values (P5:p200) in O5:O200 is a corresponding
date as to when the values were recorded. How can I calculate an average of
values collected within a specific month.

Thanks
 
G

Gaurav

=AVERAGE(IF(MONTH($O$5:$O$200)=1,$P$5:$P$200))

This is for January. Change 1 to 2 for Feb, 3 for March etc.

It is an array formula and needs CTRL+SHIFT+ENTER not just ENTER.
 
M

Mike H

Ignore the last answer which wasn't the question you asked:)

This hopefilly is

=AVERAGE(IF((MONTH(P5:p200)=1)*ISNUMBER(P5:p200),(O5:O200),""))

This is an array so commit with CTRL+Shift+Enter Not by simply pressing enter.

Mike
 
S

sarahg

Thanks Guarav,

Works for all months except January - not all of the cells contain data yet.
I have a sumproduct formula calculating something else and know that you add
--(YEAR(RP!$E$5:$E$200)=2009) into the formula.

is something similar required in this, and if so what/where.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top