Perform a Mixed Two-Way ANOVA with Excel Data
Question details
The user wants to perform a two-way ANOVA with one between-subjects factor and one within-subjects factor using data organized in Excel.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Participants belong to different groups and are measured under multiple conditions or at multiple time points.
- Observed behavior
- The desired analysis compares group and condition effects while accounting for repeated observations from each participant.
Identify each participant, their between-subjects group, each repeated condition, and the corresponding numeric response. Check whether every participant has a measurement for every condition; missing or unequal observations may require a different model.
Organize Excel data and run a mixed ANOVA in R
Use this approach for a complete, balanced design with one response per participant per condition.
Excel's standard Analysis ToolPak does not provide a dedicated mixed-design ANOVA. A repeated-measures model must account for observations from the same participant rather than treating them as independent.
In Excel, create columns named subject, group, condition, and response. Enter one row per participant per condition, with the same subject identifier and group on each participant's rows.
Choose File > Save As and select CSV as the file type. Save the worksheet with the four column headers in the first row.
In R, run dat <- read.csv(file.choose()) and select the CSV file. Then run dat$group <- factor(dat$group); dat$condition <- factor(dat$condition); dat$subject <- interaction(dat$group, dat$subject) to define the factors and make subject identifiers unique across groups.
In R, run fit <- aov(response ~ group * condition + Error(subject/condition), data = dat), then run summary(fit). Review the group, condition, and group-by-condition interaction results in their respective error strata.
Review the data for complete, balanced observations and assess residual normality, variance assumptions, and, when there are more than two conditions, sphericity. If observations are missing or the design is unbalanced, consider a mixed-effects model or consult a statistician.

Enable Excel's Analysis ToolPak for supported ANOVA tests
Use the ToolPak for other ANOVA procedures that match its supported designs, not as a direct mixed-ANOVA solution.
Prepare Mixed ANOVA Data in WPS Spreadsheets
WPS Office is a free, lightweight Office alternative with a familiar spreadsheet interface. Open Excel workbooks to organize repeated-measures data, then export the data for analysis in statistical software; WPS does not replace a dedicated mixed-ANOVA model.

Frequently Asked Questions
Can Excel's Analysis ToolPak run a mixed-design ANOVA directly?
No. The standard ToolPak includes other ANOVA procedures but not a dedicated mixed-design ANOVA. Use a repeated-measures model in software such as R, SPSS, or a suitable specialized add-in.
How should I arrange repeated-measures data in Excel?
Create subject, group, condition, and response columns, with one row for each participant's measurement in each condition. Keep the participant identifier and group consistent across that participant's rows.
Why can't I treat each measurement as an independent sample?
Measurements from the same participant are related. A mixed-design analysis accounts for this relationship when estimating the condition and interaction effects.
What if some participants are missing a condition?
Check the missing entries in the worksheet before analysis. The balanced-design R example may not be appropriate; a mixed-effects model can often accommodate incomplete data, subject to its assumptions.
How do I make the Data Analysis button appear in Excel?
In Excel for Windows, select File > Options > Add-ins, choose Excel Add-ins, click Go, and enable Analysis ToolPak. On Excel for Mac, look under Tools > Excel Add-ins.




