TTEST function
Returns the p-value of a Student's t-test comparing the means of two samples (paired, equal or unequal variance). Replaced by T.TEST.
Available in All versions of Excel, including Microsoft 365 and Excel for the web (kept for compatibility)
In every Excel versionWorks in Google Sheets
Syntax
TTEST(array1, array2, tails, type)| Argument | What it means | |
|---|---|---|
array1 | Required | The first data set. |
array2 | Required | The second data set. |
tails | Required | 1 for a one-tailed test, 2 for two-tailed. |
type | Required | 1 = paired, 2 = two samples with equal variance, 3 = two samples with unequal variance (Welch). |
Returns: The p-value of the test.
How TTEST works
TTEST answers "are these two averages really different, or could the gap be chance?". It runs the whole t-test — means, variances, standard error, degrees of freedom — and returns only the p-value. A value below your significance level (often 0.05) means the difference is statistically significant.
Choosing type matters. Use 1 (paired) when each value in the first range belongs to the same subject as the value beside it: scores before and after training, the same machines measured twice. Use 2 when the groups are independent and have similar spread, and 3 (Welch) when they are independent and their variances may differ — the safe default if you are unsure. For a paired test both ranges must have the same number of values.
Compatibility note: TTEST is one of the older statistical functions that Excel 2010 moved to the Compatibility group. It still works in every version, but for new workbooks Microsoft recommends T.TEST. Identical arguments; rename to T.TEST(array1, array2, tails, type).
Examples
1Paired test: did training help?
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Employee | Before | After | ||
| 2 | A | 82 | 86 | 0.0177 | |
| 3 | B | 75 | 79 | ||
| 4 | C | 91 | 90 | ||
| 5 | D | 68 | 74 | ||
| 6 | E | 77 | 83 | ||
| 7 | F | 85 | 88 |
Result: 0.0177
Each employee is measured twice, so the test is paired. The average gain is 3.67 points and the two-tailed p-value is 0.0177 (formatted to 4 decimals): a significant improvement.
2Two independent groups
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Store A daily sales (k) | Store B daily sales (k) | ||
| 2 | 23 | 21 | 0.0095 | |
| 3 | 27 | 24 | ||
| 4 | 25 | 22 | ||
| 5 | 30 | 25 | ||
| 6 | 26 | 20 | ||
| 7 | 29 | 23 |
Result: 0.0095
The stores are different samples with similar spread, so type 2 is used. The p-value of 0.0095 (formatted to 4 decimals) is well below 0.05: store A really does sell more.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#N/A | type is 1 (paired) and the ranges have different numbers of values. | Use equal-sized ranges for paired tests, or type 2/3 for independent samples. |
#NUM! | tails is not 1 or 2, or type is not 1, 2 or 3. | Check the last two arguments. |
#DIV/0! | A range has too few values or no variation. | Provide at least two values in each range. |
Tips
- Swapping the two ranges does not change the p-value.
- One-tailed p-values are half the two-tailed value; only use tails = 1 if you decided the direction before seeing the data.
Questions
Should I still use TTEST?
Only if the workbook must open in Excel 2007 or earlier. Otherwise use T.TEST, which gives the same result and makes the intent clearer to the next person who reads the formula.
Will TTEST stop working?
There is no announced removal date. Microsoft keeps compatibility functions so old workbooks keep calculating, but they get no new features.
Google Sheets
TTEST also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
TTEST in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Dutch | T.TOETS |
| Finnish | TTESTI |
| French | TEST.STUDENT |
| Hungarian | T.PRÓBA |
| Italian | TEST.T |
| Polish | TEST.T |
| Portuguese (Brazil) | TESTET |
| Portuguese (Portugal) | TESTET |
| Russian | ТТЕСТ |
| Spanish | PRUEBA.T |