Fix Excel Paired T-Test #DIV/0! Error
Question details
The user encounters a #DIV/0! error for the t-statistic, p-value, and critical values when attempting to perform a paired t-test via the Data Analysis Toolpak.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Running a paired t-test using the data analysis tool on two sets of numerical data.
- Observed behavior
- Excel calculates means, variances, and degrees of freedom correctly but outputs #DIV/0! errors for the t-statistic and related probability values.
Ensure that your two data arrays contain the exact same number of paired observations and have no hidden blank cells or text values.
Clean Data and Align Paired Ranges
The most common cause of a #DIV/0! error in paired t-tests is mismatched dataset sizes or non-numeric characters hidden in the selected ranges.
Paired t-tests strictly require identical sample sizes for both groups. If one array includes a blank cell or text while the other has a number, Excel cannot calculate the paired difference, resulting in an error.
Select your first data range and verify that every cell contains a valid number.
Check your second data range to confirm it starts and ends on the exact same rows as the first range.
Delete any entire rows where a value is missing (blank) or contains text in either the pre-test or post-test columns.
Open the Data Analysis Toolpak again and select your newly cleaned, identically sized ranges.

Check for Zero Variance in Paired Differences
If the difference between every pair in your dataset is exactly the same, the variance of differences is zero, causing a mathematical division by zero error.
Calculate T-Test Manually Using Formulas
Bypassing the Data Analysis Toolpak and using Excel's built-in formulas can help you isolate underlying array calculation errors.
Use WPS Spreadsheets for Accurate T-Test Analysis
WPS Spreadsheets provides powerful, built-in statistical formulas to easily run paired t-tests. Clean your data efficiently and calculate accurate t-statistics instantly without complex toolpak configurations.
- 1. Open Data: Launch WPS Spreadsheets and open your .xlsx workbook containing the paired data.
- 2. Select Target Cell: Click on an empty cell where you wish to generate the t-test probability result.
- 3. Enter T.TEST Formula: Type =T.TEST( and select your first data array, followed by a comma, and select the second array.
- 4. Define Parameters: Add , 2, 1) to specify a two-tailed distribution and a paired t-test, then press Enter to get your results.

Frequently Asked Questions
What does a #DIV/0! error mean in Excel data analysis?
A #DIV/0! error occurs when a formula attempts to divide a number by zero. In statistical tests, this usually happens if the variance of the paired differences is exactly zero, making the standard error zero and breaking the t-statistic equation.
Why do the mean and degrees of freedom show up, but not the t-statistic?
The mean and degrees of freedom only require simple counting and averaging of the datasets, which does not involve division by standard deviation. The t-statistic requires dividing the mean difference by the standard error. If the standard error evaluates to zero or encounters a blank cell mismatch, only the final t-stat and p-values will error out.
Can I run a paired t-test if my sample sizes are different?
No. A paired t-test strictly requires two dependent samples of identical size. If you have unequal sample sizes, you must either remove unpaired data points to balance the sets or perform a two-sample unequal variance t-test instead.




