If namcol(i) = "Mon" Then monsum = monsum + (fitcol(i) - monav) ^ 2: n = n + 1
Set fitcol = taborg.Offset(, 4 + reps).Resize(brtt)
Set namcol = taborg.Offset(-1).Resize(brtt + 1)
My use of namcol(i) and fitcol(i) assumes two parallel ranges, each row associating line-by-line. That was readily apparent from your original posting [....] It is not so apparent to me with your current assignments above.
Set fitcol = taborg.Offset(, 4 + reps).Resize(brtt)
Set namcol = taborg.Offset(-1).Resize(brtt + 1)
My use of namcol(i) and fitcol(i) assumes two parallel ranges, each row associating line-by-line. [....] It is not so apparent to me with your current assignments above.
Okay, that much is apparent, on closer inspection.
Set taborg = Range("A2")
Set namcol = Range(taborg, taborg.End(xlDown))
brtt = namcol.Count
reps = 4 'Range("reps").Value in this case reps = 4
Set fitcol = taborg.Offset(, 4 + reps).Resize(brtt)
Set taborg = Range("A2")
Set namcol = Range(taborg, taborg.End(xlDown))
brtt = namcol.Count
reps = 4 'Range("reps").Value in this case reps = 4
Set fitcol = taborg.Offset(, 4 + reps).Resize(brtt)
For i = 1 To brtt
If namcol(i) = "Mon" Then monsum = monsum + (fitcol(i) - monav) ^ 2: n = n + 1
Next
samstdev = Sqr(monsum / (n - 1))