PDA

View Full Version : Solved: Calculating average based on some criterion



arrun
08-12-2008, 12:06 AM
I have folowing dataset :

Price
1-Jan-05 1400
2-Jan-05 1400
3-Jan-05 1400
4-Jan-05 1390
5-Jan-05 1375
6-Jan-05 1370



Now I want to calculate average for the subset of data. Like average price before and on 4-Jan-05 (this entry is again at some cell say, A10) i.e I want to get average value of 1st four price. Can anyone please tell me how to do that?

Bob Phillips
08-12-2008, 12:45 AM
=AVERAGE(IF(A2:A7<A10,B2:B10))

which is an array formula, so commit with Ctrl-Shift-Enter, not just Enter

arrun
08-12-2008, 01:42 AM
Thank you so much.