Table of Contents
How can the Friedman Test be performed in Excel?
Introduction to the Friedman Test in Statistical Analysis
The Friedman Test serves as a vital non-parametric alternative to the Repeated Measures ANOVA. In the realm of statistics, researchers often encounter situations where the assumptions required for parametric tests, such as normality of residuals or sphericity, are not met. The Friedman Test provides a robust solution by utilizing ordinal data rankings rather than raw mean values, making it less sensitive to outliers and non-normal distributions.
Specifically, this test is employed to determine whether there is a statistically significant difference between the medians of three or more related groups. These groups usually consist of the same subjects measured under different conditions or at different time points, which is known as a within-subjects design. By focusing on the consistency of rankings across subjects, the test evaluates whether the treatment effects are uniform or if certain conditions consistently outperform others.
This comprehensive tutorial provides a step-by-step guide on how to perform the Friedman Test using Microsoft Excel. Although Excel does not have a built-in “one-click” function for this specific test, we can leverage its powerful formula capabilities and the Chi-square distribution functions to achieve accurate results. Understanding this process is essential for analysts who require a reliable method for evaluating dependent samples without the complexity of specialized statistical software.
Conceptual Overview and Theoretical Framework
Before proceeding with the practical application, it is important to understand the null hypothesis (H0) and the alternative hypothesis (H1) associated with the Friedman Test. The null hypothesis posits that there is no difference between the treatments, meaning all groups come from the same distribution. Conversely, the alternative hypothesis suggests that at least one treatment group differs significantly from the others in terms of its central tendency.
The Friedman Test works by ranking the values within each horizontal row (each subject) from smallest to largest. This process effectively removes the influence of individual subject variance, allowing the test to focus purely on the effect of the treatment variables. Because it relies on ranks, the test is particularly useful for Likert scale data or any dataset where the interval between values is not strictly consistent.
In many research scenarios, such as clinical trials or user experience studies, the Friedman Test is the preferred choice when the sample size is small or when the data is inherently skewed. By the end of this tutorial, you will be able to calculate the test statistic, known as “Q” or “Friedman’s Chi-square,” and derive a p-value to make informed data-driven decisions.
Step 1: Organizing the Dataset for Analysis
The first step in conducting a Friedman Test is to ensure your data is correctly formatted within the Excel environment. To ensure clarity and precision, your data should be arranged in a matrix where each row represents a unique subject (or “block”) and each column represents a different level of the independent variable (the treatments or time points).
In our provided example, we examine the reaction time (measured in seconds) of 10 distinct patients across three different pharmaceutical drugs. It is critical that each patient is exposed to all three drugs to maintain the repeated measures structure. If a patient is missing data for one of the drugs, they must generally be excluded from the analysis or their missing value must be addressed through imputation techniques.
Properly labeling your columns (Drug 1, Drug 2, Drug 3) and your rows (Patient 1 through Patient 10) prevents confusion during the ranking phase. Once the data is entered, you can visually inspect it for any glaring errors or anomalies before moving to the computational steps. Refer to the image below for the ideal data layout in Excel.

Step 2: Ranking the Data within Subjects
After the raw data is established, the next phase involves transforming the continuous reaction times into ranks. For each subject (row), we assign a rank of 1 to the fastest reaction time, a 2 to the next, and a 3 to the slowest. To automate this in Excel, we utilize the RANK.AVG function.
The RANK.AVG function is specifically chosen because it handles ties by assigning the average rank to the identical values, ensuring the sum of ranks remains constant. For Patient 1, you would apply the formula across the range containing their scores for Drug 1, Drug 2, and Drug 3. This ensures that the ranking is performed within the subject rather than across the entire dataset.
By dragging the formula down for all 10 patients, you create a new table of ranks. This transformation is what allows the Friedman Test to remain distribution-free, as the actual magnitude of the difference between 1.5 seconds and 2.0 seconds is discarded in favor of their relative positions. The following images demonstrate the application of this formula and the resulting ranked table.


Step 3: Calculating Sums and Squared Ranks
With the ranking table complete, we must now aggregate the data to prepare for the test statistic calculation. We calculate the sum of the ranks for each specific treatment group (each column). If one drug consistently results in faster reaction times, its column rank sum will be significantly lower or higher than the others, depending on the ranking direction.
In Excel, you will use the SUM function at the bottom of each drug column. Additionally, the Friedman formula requires the squared sum of these ranks. This involves squaring each individual column sum and then adding those squares together. This aggregate value represents the variance observed between the treatment groups.
The precision of these sums is paramount, as they are the primary inputs for the final formula. Even a minor error in the ranking or summation will lead to an incorrect p-value. The screenshot below illustrates how to organize these intermediate calculations efficiently in your worksheet.

Step 4: Computing the Friedman Test Statistic (Q)
The core of the analysis is the Friedman test statistic, often denoted as Q or FR. The formula is expressed as follows: Q = [12 / (nk(k+1))] * ΣRj² – 3n(k+1). While this may appear complex, it is easily managed within Excel by breaking it down into its constituent components.
In this equation, n represents the total number of subjects (in our case, 10 patients), and k represents the number of treatment levels or groups (3 drugs). The term ΣRj² is the sum of the squared rank totals we calculated in the previous step. The formula essentially compares the observed sums of ranks to the expected sums of ranks under the null hypothesis.
Under the assumption that the sample size is sufficiently large, the statistic Q follows a chi-square distribution. The degrees of freedom (df) for this distribution is calculated as k – 1. In our pharmaceutical example, with 3 drugs, the degrees of freedom would be 2.
Step 5: Determining the P-Value and Significance
Once the Q statistic is calculated, we must find the p-value to determine the statistical significance of our results. In Excel, this is achieved using the CHISQ.DIST.RT function, which returns the right-tailed probability of the chi-squared distribution.
The function requires two arguments: the calculated value of Q and the degrees of freedom. If the resulting p-value is less than your chosen alpha level (commonly 0.05), you have sufficient evidence to reject the null hypothesis. This indicates that at least one of the drugs has a significantly different effect on reaction time compared to the others.
As shown in the following screenshot, our specific calculation yielded a test statistic of Q = 12.35 and a p-value = 0.00208. Because 0.00208 is significantly lower than the standard 0.05 threshold, the result is highly significant, suggesting that the choice of drug definitively impacts patient reaction times.

Interpreting and Reporting the Results
The final stage of any data analysis is the clear and concise communication of the findings. Reporting should include the name of the test performed, the sample size, the specific variables involved, the test statistic (Q), the degrees of freedom, and the p-value. This level of detail ensures transparency and allows others to validate your conclusions.
In our case, we can conclude that the type of medication administered to the patients resulted in statistically significant differences in their reaction speeds. While the Friedman Test tells us that a difference exists, it does not specify which pairs of drugs are different. For that level of granularity, a post-hoc analysis, such as the Nemenyi test or Wilcoxon signed-rank tests with Bonferroni correction, would be required.
A formal summary of the results might look like this:
A Friedman Test was conducted on 10 patients to examine the effect of three different pharmaceutical drugs on reaction time. A within-subjects design was utilized, ensuring each patient was tested under each drug condition.
The results of the analysis indicated a statistically significant difference in reaction times based on the drug administered (Q = 12.35, df = 2, p = 0.00208). These findings suggest that the specific chemical composition of the drugs influences cognitive or motor response efficiency.
Advantages of Using Excel for Non-Parametric Testing
Utilizing Excel for the Friedman Test offers several benefits, particularly for those who may not have access to expensive statistical software like SPSS or SAS. Excel’s transparency allows the user to see every stage of the calculation, from the initial ranking to the final chi-square transformation, which fosters a deeper understanding of the underlying mechanics of the test.
Furthermore, Excel allows for easy data manipulation and visualization. Once the test is complete, researchers can quickly generate box plots or line graphs to visualize the trends in the medians across groups. This integration of calculation and visualization makes it a versatile tool for business intelligence, academic research, and clinical data management.
In summary, the Friedman Test is a powerful non-parametric tool that is easily accessible through the logical application of Excel functions. By following this structured approach, you can ensure that your related-samples data is analyzed with the highest degree of statistical integrity, leading to more reliable and actionable insights.
Cite this article
stats writer (2026). How to Perform a Friedman Test in Excel to Compare Related Groups. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-the-friedman-test-be-performed-in-excel/
stats writer. "How to Perform a Friedman Test in Excel to Compare Related Groups." PSYCHOLOGICAL SCALES, 10 Mar. 2026, https://scales.arabpsychology.com/stats/how-can-the-friedman-test-be-performed-in-excel/.
stats writer. "How to Perform a Friedman Test in Excel to Compare Related Groups." PSYCHOLOGICAL SCALES, 2026. https://scales.arabpsychology.com/stats/how-can-the-friedman-test-be-performed-in-excel/.
stats writer (2026) 'How to Perform a Friedman Test in Excel to Compare Related Groups', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-the-friedman-test-be-performed-in-excel/.
[1] stats writer, "How to Perform a Friedman Test in Excel to Compare Related Groups," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, March, 2026.
stats writer. How to Perform a Friedman Test in Excel to Compare Related Groups. PSYCHOLOGICAL SCALES. 2026;vol(issue):pages.
