conditional formula
Try these:
For the average...
Array entered**
=AVERAGE(IF((YEAR(F1:F1000)=2008)*(H1:H1000=0),H1 :H1000))
** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.
For the count...
=SUMPRODUCT(--(YEAR(F1:F1000)=2008),--(H1:H1000=0))
Note that in both formulas empty cells will evaluate to be =0. So if you do
have empty cells you'll have to account for them to be excluded.
--
Biff
Microsoft Excel MVP
"PAL" wrote in message
...
I have a worksheet with ~10 columns and a 1000 rows.
In column F, I have a date that has a range of several years.
In column H I have a value, which sometimes is 0 or negative.
I need two formulas:
1) I would like to create a formula that would take the average value
(from
column H) providing it was greater than or equal to 0 for a given year.
So
for 2007 the average value is, say 10. For 2008, 12, etc....
2) I would like the second formula, simple count the n that went into
determining the average.
|