Let's say your monthly data is in columns b-m .
For column 2 data
=SUMIF(B2:M2,"<>-9999",B2:M2)
This is the sum of months without a -9999 value entered
TO count the number of times -9999 is entered in the row, use this
=COUNTIF(B2:M2,"=-9999")
Without using VBA, I'd probably use autofilter to find those rows that have
-9999 in them and add the average you want.
Come back if you have more questions.
> I have a 20,000+ row table with twelve columns of monthly precipitation data.
> Each column is a month of the year and each row is a yearly record. Missing
[quoted text clipped - 17 lines]
> Thank you!
> Ian
Barb, thank you for the post--very helpful!
I still have one question:
Is there anyway to automate taking the average of the months on either side
of a missing field to fill in that field? Take the following example:
203 202 -9999 231 96 186 152 646 139 430 169 209
With your previous instructions I was able to automate using an average
based on the 11 other months and use that value to place into the missing
field. Now I'd like to use the average of "202" and "231" to fill in "-9999".
Also, I suspect this type of data string will cause problems because the two
missing fields are next to one another. Here I'd like to use the average of
"568" and "301" to fill in both missing fields.
150 148 26 81 448 262 328 568 -9999 -9999 66 301
Thanks!
Ian
> > in the missing field (month) and then sum the row.
> Let's say your monthly data is in columns b-m .
>
[quoted text clipped - 31 lines]
> > Thank you!
> > Ian
Pete_UK - 06 Apr 2007 01:47 GMT
You can't use a formula to change a value in another cell, so you
would have to use a bit of VBA (i.e. a macro) to do what you describe.
Pete
On Apr 6, 1:28 am, I. Miller <IMil...@discussions.microsoft.com>
wrote:
> Barb, thank you for the post--very helpful!
>
[quoted text clipped - 56 lines]
>
> - Show quoted text -
Pete_UK - 06 Apr 2007 01:50 GMT
Anyway, why wouldn't you take 568 and 66 as the basis of the average
in your last example?
Pete
On Apr 6, 1:28 am, I. Miller <IMil...@discussions.microsoft.com>
wrote:
> Barb, thank you for the post--very helpful!
>
[quoted text clipped - 56 lines]
>
> - Show quoted text -