If you could post a sample of your data, a sample of what output you want, and show your calculations that would be much, much better than trying to explain an algorithm in casual English. It's a little more work for you, I understand, but it also means a much greater chance of being understood on the first try. And being all you need is a single line of data to demonstrate, it really isn't so awful. It may also help you get it organized better and see an algorithm yourself.
I don't understand what you're getting at now, and since your code doesn't work, it's not a good demonstration either.
I think I see your syntax error -- an extra bracket:
{s=0;NF==1;for(i=1;i<=NR;i++)} s+=($NF-$50)^2;print sqrt(s/NR)}
There's logic errors too, though.
The statement in blue, though, what did you intend that to do? Right now it's a complete no-op.
NR is the number of lines(records), not the number of fields, I think you want (i=1;i<=NF;i++)
and sqrt(s/NF)
I also think that's off by one, since that will include the last column, the average itself, so:
(i=1;i<NF;i++)
and sqrt(s/(NF-1))
And then, that thing in green. Since NF doesn't change until the number of columns does, this is always adding the same columns: ($NF-$50)
In fact if you have 50 columns, $NF will be column 50, causing the result to always be zero!