Assume data in cols A and B, from row1 down
In C1:C24, list the 24 numbers: 0,1,2,3,.. 23 to denote the 24 hourly bands
Place in D1, array-enter it by pressing CTRL+SHIFT+ENTER,
instead of just pressing ENTER:
=AVERAGE(IF((HOUR(A$1:A$100)=C1)*(A$1:A$100<""),B $1:B$100))
Copy down to D24 to return the results for the 24 hourly bands in col C
And to suppress #DIV/0! errors,
you could use an IF(ISERROR(...) trap for the above, viz:
=IF(ISERROR(AVERAGE(IF((HOUR(A$1:A$100)=C1)*(A$1:A $100<""),B$1:B$100))),"",AVERAGE(IF((HOUR(A$1:A$1 00)=C1)*(A$1:A$100<""),B$1:B$100)))
Adapt the ranges to suit the actual extents of your data
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Jennifer" wrote:
I have been trying for hours to try to figure this out. I have data that has
been recorded every few minutes over a two week period for temperature, say
time is in column A in mm/dd/yy hh:mm:ss and my temperature is in column B. I
have many different data sets not taken at equal times. Is there a way to
Average the temperature over each hour? so... formulate an If statement or
something like that where If(still in the same hour):then(add to previous
total/average)?
Any help would be great!!!
:)