Pearson's is used for determining if there is a correlation between variables, a t-test measures the difference between two populations, so they look at different things.

I always use TTEST function and I have no problem. But the above equation gives me different p value which is not similar to the TTEST value. I am still not sure why people use this equation to calculate the p value of those variables. I hope you understand what I' trying to say. I know r is correlation coefficient. by why can't they just use the same TTEST, instead of this equation. it shouldn't be used?