Perform a Wilcoxon Signed Rank Test in Excel (Step-by-Step)


The Wilcoxon Signed-Rank Test (WSRT) stands as a foundational and highly valuable tool in modern non-parametric statistics. It serves as the primary alternative to the traditional paired sample t-test when analyzing dependent data, such as before-and-after measurements or matched pairs.

Researchers specifically employ the WSRT when they need to rigorously test whether a meaningful difference exists between the medians of two related populations. This test is essential whenever the crucial assumption of the t-test—that the distribution of the differences between the paired samples follows a normal distribution—cannot be reasonably met or verified.

This comprehensive, step-by-step tutorial is designed to walk you through the entire process of conducting a complete and accurate Wilcoxon Signed-Rank Test directly within the familiar environment of Microsoft Excel, transforming raw data into conclusive statistical evidence.

Step 1: Structuring the Data and Establishing the Scenario

To illustrate the utility of the WSRT, we will utilize a practical scenario. Imagine a mechanical engineer who is tasked with determining if a newly developed, specialized fuel treatment significantly impacts a car’s fuel efficiency, measured in miles per gallon (MPG).

The engineer employs a paired-design structure, testing 12 identical vehicles. MPG performance is measured twice for each car: once before the treatment (designated as the Control or Group 2) and again after the treatment has been applied (designated as the Treatment or Group 1). This structure ensures that variability stemming from differences between individual cars is controlled, making the WSRT the ideal analytical choice.

The first critical step in Excel is accurately entering and labeling this data. We must ensure two distinct columns contain the paired MPG values, clearly marking one for the pre-treatment condition and one for the post-treatment condition, facilitating subsequent calculations.

Step 2: Calculating the Raw Differences Between Paired Observations

The foundation of the Wilcoxon Signed-Rank Test rests on analyzing the change observed within each pair. Therefore, our immediate next task is to calculate the raw numerical difference for every corresponding observation.

To achieve this, we subtract the MPG reading without the treatment (Group 2) from the MPG reading with the treatment (Group 1) for every single car. This arithmetic operation is vital because the resulting value reveals both the magnitude and the direction (positive or negative sign) of the change attributed to the fuel treatment.

You should create a new, clearly labeled column, typically titled “Difference,” to systematically store the results of these subtractions, preparing the dataset for the next transformation step.

Step 3: Determining the Absolute Differences and Handling Ties

Once the raw differences are calculated, the subsequent step involves determining the absolute difference. This is a crucial procedural element of the WSRT, as it effectively removes the directional information (the positive or negative sign) to isolate and measure only the pure magnitude of the change.

In Excel, this is easily accomplished using the built-in function: ABS(). Apply this function to every value in your “Difference” column. Furthermore, a critical rule of the WSRT must be observed here: if the difference calculated for a specific car is exactly zero, that observation represents a tie between the conditions and must be excluded entirely from the subsequent ranking process. For these zero differences, you should return a blank value or simply skip the absolute difference calculation.

Step 4: Ranking the Absolute Magnitudes of Change

With the absolute differences established, the procedure moves into the ranking phase. This step of assigning a numerical rank to each non-zero absolute difference is what defines the test’s non-parametric nature, as it uses the rank order rather than the raw score magnitude.

We must use the RANK.AVG() function in Excel for this calculation. Utilizing RANK.AVG() is vital because it correctly manages tied ranks: if two or more cars share the exact same absolute difference value, this function ensures they are assigned the average of the ranks they would have collectively occupied, maintaining the statistical integrity of the test.

A new column should be designated for these ranks. It is essential to ensure that any observation that had an original difference of zero (and was thus excluded in Step 3) remains blank in this rank column as well.

Step 5: Separating Ranks Based on Original Directional Sign

The next critical step is to reintroduce the directional information that was temporarily removed in Step 3. We must separate the calculated ranks into two distinct groups based on the sign of the original difference: positive ranks ($R_+$) and negative ranks ($R_-$).

The positive ranks correspond to pairs where the difference (Group 1 – Group 2) was positive, indicating an improvement in MPG performance after the treatment. To calculate this sum, utilize a conditional IF() statement in Excel, instructing it to pull the rank value only if the corresponding original difference was greater than zero.

Conversely, the negative ranks correspond to pairs where the difference was negative, signifying a decrease or negative outcome in MPG performance after the treatment. Calculate the sum of the negative ranks using a similar conditional IF() statement, pulling the rank only when the original difference was less than zero.

Step 6: Calculating the Test Statistic (W) and Effective Sample Size (N)

The penultimate step involves determining the Wilcoxon test statistic ($W$) and accurately identifying the effective sample size ($N$). These two values are the final figures required for formal hypothesis testing.

The Wilcoxon test statistic ($W$) is defined simply as the smaller sum of the two calculated rank totals: the sum of the positive ranks ($sum R_+$) or the sum of the negative ranks ($sum R_-$). Use the MIN() function in Excel on the two sums to identify $W$.

Next, calculate the effective sample size ($N$). This value represents the total count of all observations that received a rank (i.e., the total number of paired differences that were not zero). Use the COUNT() function on your complete rank column to determine $N$, ensuring zero-difference observations are excluded.

Wilcoxon Signed Rank Test in Excel

For the specific fuel treatment example, the resulting calculated test statistic ($W$) is found to be 10.5, and the effective sample size ($N$), having excluded one zero difference, is 11.

Step 7: Interpreting the Results Using Critical Values

With $W$ and $N$ determined, we can now establish the formal statistical hypotheses for our two-tailed test:

  • H0 (Null Hypothesis): The median MPG performance is equal between the two groups. (Stated simply: The fuel treatment has no statistically significant effect.)

  • HA (Alternative Hypothesis): The median MPG performance is not equal between the two groups. (Stated simply: The fuel treatment causes a significant change in MPG.)

To make the final decision regarding whether to reject or fail to reject the null hypothesis, we must compare our calculated test statistic ($W=10.5$) against the appropriate critical value. This value is derived from a standard Wilcoxon Signed-Rank Test Critical Values Table, using a predetermined alpha level ($alpha$) of 0.05 and our effective sample size ($N$) of 11.

Upon consulting the referenced table, we find that the two-tailed critical value corresponding to $alpha = .05$ and $N = 11$ is precisely 10.

The established decision rule for the Wilcoxon Signed-Rank Test dictates that we must reject the null hypothesis if the calculated test statistic ($W$) is less than or equal to the critical value. Since our test statistic (10.5) is numerically larger than the critical value (10), we definitively fail to reject the null hypothesis.

This outcome implies that, based on the statistical evidence gathered, there is insufficient proof to conclude that the mean MPG performance is significantly different after the application of the specialized fuel treatment. The engineer cannot claim a statistically significant effect.

Bonus Tip: For verification of your manual calculations or for quick reference, specialized online calculators can automatically compute the Wilcoxon test statistic ($W$) based on your input data.

Cite this article

Mohammed looti (2025). Perform a Wilcoxon Signed Rank Test in Excel (Step-by-Step). PSYCHOLOGICAL STATISTICS. Retrieved from https://statistics.arabpsychology.com/perform-a-wilcoxon-signed-rank-test-in-excel-step-by-step/

Mohammed looti. "Perform a Wilcoxon Signed Rank Test in Excel (Step-by-Step)." PSYCHOLOGICAL STATISTICS, 5 Nov. 2025, https://statistics.arabpsychology.com/perform-a-wilcoxon-signed-rank-test-in-excel-step-by-step/.

Mohammed looti. "Perform a Wilcoxon Signed Rank Test in Excel (Step-by-Step)." PSYCHOLOGICAL STATISTICS, 2025. https://statistics.arabpsychology.com/perform-a-wilcoxon-signed-rank-test-in-excel-step-by-step/.

Mohammed looti (2025) 'Perform a Wilcoxon Signed Rank Test in Excel (Step-by-Step)', PSYCHOLOGICAL STATISTICS. Available at: https://statistics.arabpsychology.com/perform-a-wilcoxon-signed-rank-test-in-excel-step-by-step/.

[1] Mohammed looti, "Perform a Wilcoxon Signed Rank Test in Excel (Step-by-Step)," PSYCHOLOGICAL STATISTICS, vol. X, no. Y, ص Z-Z, November, 2025.

Mohammed looti. Perform a Wilcoxon Signed Rank Test in Excel (Step-by-Step). PSYCHOLOGICAL STATISTICS. 2025;vol(issue):pages.

Download Post (.PDF)
Scroll to Top