Standard Deviation result in c and excel is different

I have a problem of translating the standard deviation formula into c programming.
The result come out a bit higher than excel. Do anyone knows how to solve the problem.

float STD_pr_TemSum;
float STD_ps_TemSum;

int count2, m, n, l;

for (m=14; m<NUM_RECORD; m++)
{
count2=1;
n=m;
l=14;
STD_pr_TemSum=0;
STD_ps_TemSum=0;

while(count2<=l)
{
STD_pr_TemSum += pow(PR[n]-MAPR[l],(float)2);
STD_ps_TemSum += pow(PS[n]-MAPS[l],(float)2);
n--;
count2++;
}

STD_pr[m] = sqrt(STD_pr_TemSum/(float)(l-1));
STD_ps[m] = sqrt(STD_ps_TemSum/(float)(l-1));
}
Have you tried using double instead of float?
Tried using double instead of float given out the same result, the result difference from excel..
already solve, thank..
Topic archived. No new replies allowed.