How to Calculate P-Values in Excel (3 Examples) - Statology (2024)

In statistics, we use hypothesis tests to determine whether some claim about a population parameter is true or not.

When we perform a hypothesis test, we often receive a t-score test statistic as a result.

Once we find this t-score test statistic, we can then find the p-value associated with it.

If this p-value is less than a certain value (e.g. 0.10, 0.05, 0.01), then we reject the null hypothesis of the test and conclude that our findings are statistically significant.

The following examples show how to calculate a p-value for a test statistic in Excel in three different scenarios.

Example 1: Calculate P-Value for Two-Tailed Test

Suppose a botanist wants to know if the mean height of a certain species of plant is equal to 15 inches.

In a random sample of 12 plants, she finds that the sample mean height is 14.33 inches and the sample standard deviation is 1.37 inches.

She performs a hypothesis test using the following null and alternative hypotheses:

H0 (Null Hypothesis): μ= 15 inches

HA (Alternative Hypothesis): μ ≠ 15 inches

The test statistic is calculated as:

  • t = (x – µ) / (s/√n)
  • t = (14.33-15) / (1.37/√12)
  • t = -1.694

The degrees of freedom associated with this test statistic is n-1 = 12-1 = 11.

To find the p-value for this test statistic, we will use the following formula in Excel:

=T.DIST.2T(ABS(-1.694), 11)

The following screenshot shows how to use this formula in practice.

How to Calculate P-Values in Excel (3 Examples) - Statology (1)

The two-tailed p-value is 0.1184.

Since this value is not less than .05, we fail to reject the null hypothesis. We do not have sufficient evidence to say that the mean height of plants is different from 15 inches.

Example 2: Calculate P-Value for Left-Tailed Test

Suppose it’s assumed that the average weight of a certain widget produced at a factory is 20 grams. However, one inspector believes the true average weight is less than 20 grams.

To test this, he weighs a simple random sample of 20 widgets and obtains the following information:

  • n = 20 widgets
  • x = 19.8 grams
  • s = 3.1 grams

He then performs a hypothesis test using the following null and alternative hypotheses:

H0 (Null Hypothesis): μ ≥ 20 grams

HA (Alternative Hypothesis): μ < 20 grams

The test statistic is calculated as:

  • t = (x – µ) / (s/√n)
  • t = (19.8-20) / (3.1/√20)
  • t = -.2885

The degrees of freedom associated with this test statistic is n-1 = 20-1 = 19.

To find the p-value for this test statistic, we will use the following formula in Excel:

=T.DIST(-.2885, 19, TRUE)

The following screenshot shows how to use this formula in practice.

How to Calculate P-Values in Excel (3 Examples) - Statology (2)

The left-tailed p-value is 0.388044.

Since this value is not less than .05, the inspector fails to reject the null hypothesis. He does not have sufficient evidence to say that the true mean weight of widgets produced at this factory is less than 20 grams.

Note: We used the argument TRUE to specify that the cumulative distribution function should be used when calculating the p-value.

Example 3: Calculate P-Value for Right-Tailed Test

Suppose it’s assumed that the average height of a certain species of plant is 10 inches tall. However, one botanist claims the true average height is greater than 10 inches.

To test this claim, she goes out and measures the height of a simple random sample of 15 plants and obtains the following information:

  • n = 15 plants
  • x = 11.4 inches
  • s = 2.5 inches

She then performs a hypothesis test using the following null and alternative hypotheses:

H0 (Null Hypothesis): μ ≤ 10 inches

HA (Alternative Hypothesis): μ > 10 inches

The test statistic is calculated as:

  • t = (x – µ) / (s/√n)
  • t = (11.4-10) / (2.5/√15)
  • t = 2.1689

The degrees of freedom associated with this test statistic is n-1 = 15-1 = 14.

To find the p-value for this test statistic, we will use the following formula in Excel:

=T.DIST.RT(2.1689, 14)

The following screenshot shows how to use this formula in practice.

How to Calculate P-Values in Excel (3 Examples) - Statology (3)

The right-tailed p-value is 0.023901.

Since this value is less than .05, the botanist can reject the null hypothesis. She has sufficient evidence to say that the true mean height for this species of plant is greater than 10 inches.

Additional Resources

The following tutorials explain how to perform other common tasks in Excel:

How to Find a P-Value from a Z-Score in Excel
How to Find the P-Value of an F-Statistic in Excel
How to Find the P-Value of a Chi-Square Statistic in Excel

Featured Posts

How to Calculate P-Values in Excel (3 Examples) - Statology (4)

7 Best YouTube Channels to Learn Statistics for Free

May 20, 2024

How to Calculate P-Values in Excel (3 Examples) - Statology (5)

5 Regularization Techniques You Should Know

May 13, 2024

How to Calculate P-Values in Excel (3 Examples) - Statology (6)

Statistics Cheat Sheets to Get Before Your Job Interview

May 6, 2024

How to Calculate P-Values in Excel (3 Examples) - Statology (7)

5 Statistical Biases to Avoid

April 25, 2024

How to Calculate P-Values in Excel (3 Examples) - Statology (8)

5 Free Statistics Courses for Beginners

April 19, 2024

How to Calculate P-Values in Excel (3 Examples) - Statology (9)

5 MIT Statistics Courses That Are Free

April 18, 2024

How to Calculate P-Values in Excel (3 Examples) - Statology (2024)
Top Articles
Latest Posts
Article information

Author: Wyatt Volkman LLD

Last Updated:

Views: 5606

Rating: 4.6 / 5 (46 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Wyatt Volkman LLD

Birthday: 1992-02-16

Address: Suite 851 78549 Lubowitz Well, Wardside, TX 98080-8615

Phone: +67618977178100

Job: Manufacturing Director

Hobby: Running, Mountaineering, Inline skating, Writing, Baton twirling, Computer programming, Stone skipping

Introduction: My name is Wyatt Volkman LLD, I am a handsome, rich, comfortable, lively, zealous, graceful, gifted person who loves writing and wants to share my knowledge and understanding with you.