A Ttest is a way of deciding if there are statistically significant differences between datasets, using a Student’s tdistribution. The TTest in Excel is a twosample Ttest comparing the means of two samples. This article explains what statistical significance means and shows how to do a TTest in Excel.
Instructions in this article apply to Excel 2019, 2016, 2013, 2010, 2007; Excel for Office 365 and Excel Online.
What is Statistical Significance?
Imagine you want to know which of two dice will give a better score. You roll the first die and get a 2; you roll the second die and get a 6. Does this tell you the second die usually gives higher scores? If you answered, “Of course not,” then you already have some understanding of statistical significance. You understand the difference was due to the random change in the score, each time a die is rolled. Because the sample was very small (only one roll) it didn’t show anything significant.
Now imagine you roll each die 6 times:
 The first die rolls 3, 6, 6, 4, 3, 3; Mean = 4.17
 The second die rolls 5, 6, 2, 5, 2, 4; Mean = 4.00
Does this now prove the first die gives higher scores than the second? Probably not. A small sample with a relatively small difference between the means makes it likely the difference is still due to random variations. As we increase the number of dice rolls it becomes difficult to give a common sense answer to the question — is the difference between the scores the result of random variation or is one actually more likely to give higher scores than the other?
Significance is the probability that an observed difference between samples is due to random variations. Significance is often called the alpha level or simply 'α.' The confidence level, or simply 'c,' is the probability that the difference between the samples is not due to random variation; in other words, that there's a difference between the underlying populations. Therefore: c = 1 – α
We can set 'α' at whatever level we want, to feel confident we’ve proven significance. Very often α=5% is used (95% confidence), but if we want to be really sure that any differences are not caused by random variation, we might apply a higher confidence level, using α=1% or even α=0.1%.
Various statistical tests are used to calculate significance in different situations. Ttests are used to determine whether the means of two populations are different and Ftests are used to determine whether the variances are different.
Why Test for Statistical Significance?
When comparing different things, we need to use significance testing to determine if one is better than the other. This applies to many fields, for example:
 In business, people need to compare different products and marketing methods.
 In sports, people need to compare different equipment, techniques, and competitors.
 In engineering, people need to compare different designs and parameter settings.
If you want to test whether something performs better than something else, in any field, you need to test for statistical significance.
What is a Student’s TDistribution?
A Student’s tdistribution is similar to a normal (or Gaussian) distribution. These are both bellshaped distributions with most results close to the mean, but some rare events are quite far from the mean in both directions, referred to as the tails of the distribution.
The exact shape of the Student’s tdistribution depends on the sample size. For samples of more than 30 it's very similar to the normal distribution. As the sample size is reduced, the tails get larger, representing the increased uncertainty that comes from making inferences based on a small sample.
How to Do a TTest in Excel
Before you can apply a TTest to determine whether there's a statistically significant difference between the means of two samples, you must first perform an FTest. This is because different calculations are performed for the TTest depending on whether there's a significant difference between the variances.
You will need the Analysis Toolpak addin enabled to perform this analysis.
Checking and Loading the Analysis Toolpak AddIn
To check and activate the Analysis Toolpak follow these steps:

Select the FILE tab >select Options.

In the Options dialogue box, select AddIns from the tabs on the lefthand side.

At the bottom of the window, select the Manage dropdown menu, then select Excel Addins. Select Go.

Ensure the checkbox next to Analysis Toolpak is checked, then select OK.

The Analysis Toolpak is now active and you are ready to apply FTests and TTests.
Performing an FTest and a TTest in Excel

Enter two datasets into a spreadsheet. In this case, we’re considering the sales of two products during a week. The mean daily sales value for each product is also calculated, together with its standard deviation.

Select the Data tab > Data Analysis

Select FTest TwoSample for Variances from the list, then select OK.
The FTest is highly sensitive to nonnormality. It may therefore be safer to use a Welch test, but this is more difficult in Excel.

Select the Variable 1 Range and Variable 2 Range; set the Alpha (0.05 gives 95% confidence); select a cell for the top left corner of the output, considering that this will fill 3 columns and 10 rows. Select OK.
For the for Variable 1 Range, the sample with the largest standard deviation (or variance) must be selected.

View the FTest results to determine whether there is a significant difference between the variances. The results give three important values:
 F: The ratio between the variances.
 P(F<=f) onetail: The probability that variable 1 doesn't actually have a larger variance than variable 2. If this is larger than alpha, which is generally 0.05, then there's no significant difference between the variances.
 F Critical onetail: The value of F that would be required to give P(F<=f)=α. If this value is greater than F, this also indicates there's no significant difference between the variances
P(F<=f) can also be calculated using the FDIST function with F and the degrees of freedom for each sample as its inputs. Degrees of freedom is simply the number of observations in a sample minus one.

Now that you know whether there is a difference between the variances you can select the appropriate TTest. Select the Data tab > Data Analysis, then select either tTest: TwoSample Assuming Equal Variances or tTest: TwoSample Assuming Unequal Variances.

Regardless of which option you chose in the previous step, you will be presented with the same dialogue box to enter the details of the analysis. To start, select the ranges containing the samples for Variable 1 Range and Variable 2 Range.

Assuming you want to test for no difference between the means, set the Hypothesized Mean Difference to zero.

Set the significance level Alpha (0.05 gives 95% confidence), and select a cell for the top left corner of the output, considering that this will fill 3 columns and 14 rows. Select OK.

Review the results to decide if there's a significant difference between the means.
Just as with the FTest, if the pvalue, in this case P(T<=t), is greater than alpha, then there's no significant difference. However, in this case there are two pvalues given, one for a onetail test and the other for a twotail test. In this case, use the twotail value since either variable having a greater mean would be a significant difference.