How to Perform a Tukey Test After Two-Way ANOVA in Excel
Question details
The user wants to perform Tukey post hoc comparisons after a two-way ANOVA in Excel.

- Product
- Microsoft Excel Analysis ToolPak
- Device & OS
- not provided
- Scenario
- The user has two factors and wants to compare group means after fitting an ANOVA model.
- Observed behavior
- Excel's Analysis ToolPak does not provide a built-in Tukey post hoc test, and two-factor ANOVA with replication does not automatically account for repeated measurements.
Check whether observations come from independent subjects or from repeated measurements on the same subjects. Identify the comparisons you want to make and check the ANOVA model's assumptions, including equal error variance and approximately normal residuals.
Use statistical software for Tukey comparisons
Use a statistical package or a validated template when observations are independent and you need model-based pairwise comparisons.
In Excel, review the two-factor ANOVA table and identify the interaction, main effects, error mean square, and error degrees of freedom.
If the interaction is significant, consider comparisons between factor levels within each level of the other factor. For main effects, compare model-estimated marginal means where appropriate.
Import the data into statistical software or a validated Excel template and specify both factors and their interaction in the two-way ANOVA model.
In the software's post hoc or estimated marginal means options, select the relevant pairwise comparisons and Tukey adjustment. Use Tukey-Kramer where supported for unequal group sizes.
Review the adjusted p-values and confidence intervals for the selected comparison family. Report the model and adjustment alongside the results.

Calculate Tukey HSD for balanced cell means in Excel
Use this manual method to compare all factor-combination means when an independent-observations design has equal sample sizes in every cell.
Use a repeated-measures model for the same subjects
Use a repeated-measures ANOVA or mixed-effects model when the same subjects are measured more than once.
Work With ANOVA Data in WPS Spreadsheets
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface. Open your Excel workbook to organize ANOVA data and review calculations while moving between compatible formats. WPS does not add a built-in Tukey test to Excel's Analysis ToolPak.

Frequently Asked Questions
Does Excel's Analysis ToolPak include a Tukey test?
No. The ToolPak can produce a two-factor ANOVA with replication, but it does not provide a built-in Tukey post hoc test. Use statistical software, a validated template, or an appropriate manual calculation.
Which ANOVA values do I need for a manual Tukey HSD calculation?
For balanced independent cells, find the Within row in the ANOVA output and use its MS and df. You also need the common cell size and a studentized-range critical value for the number of means and chosen significance level.
What should I compare if the interaction is significant?
Consider simple comparisons of one factor's levels within each level of the other factor. Select the relevant estimated marginal means and a multiplicity adjustment in your statistical software.
Can I use two-factor ANOVA with replication for repeated measurements?
Not as a substitute for a repeated-measures model. If observations come from the same subjects, use software that can specify subject-level dependence and calculate comparisons from that model.
What if the group sizes are unequal?
Use software or a validated template that supports Tukey-Kramer or suitable model-based comparisons. For an unbalanced factorial design, check that the procedure uses the appropriate estimated means and standard errors.




