I looked at the old text, Regression Analysis, Module 4, "Analysis of variance"
Practice Problems: P-value
It explains how to use the excel function TDIST and TINV. I copy paste the notes below:
Calculating p-values:
Many of the values in the statistical tables in the textbook can be obtained by Excel functions. To find a p-value, use the Excel built-in function TDIST.
Click on the function icon.
Choose the function TDIST. You can search in the statistical functions or you can type in the name. You can also type a related word, such as STUDENT, and Excel shows the three built-in functions for the t distribution.
Click on the function name. Excel puts up a screen asking for three values:
~ The X value, which is the number of standard deviations.
~ The degrees of freedom, which is the number of data points minus the number of explanatory variables.
~ The tails: 2 for a two sided test and 1 for a one-sided test.
To check that you are using this function correctly, enter values for which you know the answer. For example, use 1.96 standard deviations, 10,000 degrees of freedom, and a two sided test. You should get a p-value of 5%. Excel may give you a value of 0.049999,depending on the number of decimal places you are using.
Excel also have a TINV built-in function, which does the reverse conversion: from the pvalue and the degrees of freedom, you obtain the number of standard deviations.
If you read this note carefully, p-value is calculated using TDIST(TINV,degreeOfFreedom,Tail) not TDIST(t-statistic,degreeOfFreedom,tail)
[NEAS: Using Excel’s built-in functions will help you understand the material. To check that you use them correctly, use the regression add-in. This is an add-in, not a built-in function. Excel help says:
“Use the Analysis ToolPak to perform complex data analysis: If you need to develop complex statistical or engineering analyses, you can save steps and time by using the Analysis ToolPak. You provide the data and parameters for each analysis, and the tool uses the appropriate statistical or engineering macro functions to calculate and display the results in an output table. Some tools generate charts in addition to output tables. To use the Analysis ToolPak, click Data Analysis in the Analysis group on the Data tab. If the Data Analysis command is not available, you need to load the Analysis ToolPak add-in program.”]