I discovered an issue with the previous formula. Missing values were causing an issue. Also, the data needs to be in assending date order. So please sort the table before applying the formula
If( Row() == 1,
holdMatrix = [];
dateMatrix = [];
);
If( Is Missing( :Name( "Date Time (UTC)" ) ) == 0,
If(
Is Missing( :Name( " Sea Surface Temperature (deg C)" ) ) == 1, holdMatrix = holdMatrix || 0,
:Name( " Sea Surface Temperature (deg C)" ) > 31.3, holdMatrix = holdMatrix || :time difference 2,
:Name( " Sea Surface Temperature (deg C)" ) <= 31.3, holdMatrix = holdMatrix || 0
);
dateMatrix = dateMatrix || Informat( :date, "m/d/y" );
If( N Cols( dateMatrix ) & N Cols( holdMatrix ) != 0,
While( dateMatrix[N Cols( dateMatrix )] > dateMatrix[1] + In Days( 120 ) & N Cols( holdMatrix ) > 0 & N Cols( dateMatrix ) > 0,
dateMatrix[1] = [];
holdMatrix[1] = [];
);
If( N Cols( dateMatrix ) & N Cols( holdMatrix ) != 0,
x = Sum( holdMatrix ),
x = .
);
,
x = .
);
,
x = .
);
(x / 24) / 7;
Jim