counting elements of two arrays
Thank you Joel I will try that.
Kind regards
Geoff
On Aug 23, 2:52 pm, Joel wrote:
If you want to try using countif 0 which will get the non-blank dates it
requires only one line change. This method doesn't look at bad data, just
cares if there is data or is'nt data.
chage from:
corelval = WorksheetFunction.Correl(corelarray,
colarray)
change to:
corelval = WorksheetFunction.Countif(corelarray,
"0")
If ArrayCount(colarray) ArrayCount(corelarray) * 0.1
Then
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''*'''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''
corelval = WorksheetFunction.Correl(corelarray,
colarray)
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''*'''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''
If Abs(corelval) coreltest Then
colave = WorksheetFunction.Average(colarray)
colsd = WorksheetFunction.StDev(colarray)
rsltcount = rsltcount + 1
rsltarray(rsltcount, 1) = Cells(1, c + 1)
rsltarray(rsltcount, 2) = Cells(2, c + 1)
rsltarray(rsltcount, 3) = colave
rsltarray(rsltcount, 4) = colsd
rsltarray(rsltcount, 5) = colsd / colave * 100
rsltarray(rsltcount, 6) = corelval
rsltarray(rsltcount, 7) = corelval * corelval
rsltarray(rsltcount, 8) =
WorksheetFunction.Count(colarray)
End If
End If
Next c
|