TROIA-423 averaging values with NaNs