A Kruskal-Wallis Test is used to determine whether or not there is a statistically significant difference between the medians of three or more independent groups. It is considered to be the non-parametric equivalent of the One-Way ANOVA.
This tutorial explains how to conduct a Kruskal-Wallis Test in Excel.
Example: Kruskal-Wallis Test in Excel
Researchers want to know if three different fertilizers lead to different levels of plant growth. They randomly select 30 different plants and split them into three groups of 10, applying a different fertilizer to each group. At the end of one month they measure the height of each plant.
Use the following steps to perform a Kruskal-Wallis Test to determine if the median growth is the same across the three groups.
Step 1: Enter the data.
Enter the following data, which shows the total growth (in inches) for each of the 10 plants in each group:

Step 2: Rank the data.
Next, we will use the RANK.AVG() function to assign a rank to the growth of each plant out of all 30 plants. The following formula shows how to calculate the rank for the first plant in the first group:

Copy this formula to the rest of the cells:

Then, calculate the sum of the ranks for each column along with the sample size and the squared sum of ranks divided by the sample size:

Step 3: Calculate the test statistic and the corresponding p-value.
The test statistic is defined as:
H = 12/(n(n+1)) * ΣRj2/nj – 3(n+1)
where:
- n = total sample size
- Rj2 =sum of ranks for the jth group
- nj =sample size of jth group
Under the null hypothesis, H follows a Chi-square distribution with k-1 degrees of freedom.
The following screenshot shows the formulas used to calculate the test statistic, H, and the corresponding p-value:

The test statistic is H = 6.204 and the corresponding p-value is p = 0.045. Since this p-value is less than 0.05, we can reject the null hypothesis that the median plant growth is the same for all three fertilizers. We have sufficient evidence to conclude that the type of fertilizer used leads to statistically significant differences in plant growth.
Step 4: Report the results.
Lastly, we want to report the results of the Kruskal-Wallis Test. Here is an example of how to do so:
A Kruskal-Wallist Test was performed to determine if median plant growth was the same for three different plant fertilizers. A total of 30 plants were used in the analysis. Each fertilizer was applied to 10 different plants.
The test revealed that the median plant growth was not the same (H = 6.204, p = 0.045) among the three fertilizers. That is, there was a statistically significant difference in median plant growth among two or more of the fertilizers.
The formaula doesnt explain how you got the p value though??
Find P-Value: Use =CHISQ.DIST.RT(H_Value, Num_Groups – 1) (where H_Value is your calculated H and Num_Groups is number of samples).
This is great! However, how did you get the p value? There is no formula and guidance on this. Thanks
how did you create the final pvalue? Everything else is clear
use the chi-square table
This article has been really helpful for my data analysis. In my study, participants were asked to evaluate language users on a variety of traits by using a 6 point Likert scale. I have divided the participants by gender, age and educational background, and I want to test how different their opinions were by performing a Kruskal Wallis test. I have followed every step that is well explained here, but I have difficulties with calculating the p value and I was wondering if I could get some help.
Thank you in advance!
use the chi-square table
How do you determine the corresponding p-value from the calculated H-statistic?
PLS SHARE YOUR TEMPLATE…
Hey, great explanation! But, can you explain how you got the p-value in step 3?
Well structured, but how do I calculate the p-value? You just added a random number in the excel sheet.
Hi,
How did you calculate the p-value?
How did you get the p-value from the H score?
Today is good day
Thank you very much for valuable information and simple scientific language
Hello,
how are we calculating the pvalue?
thanks!
How do you get the p-value?
How do you calculate p-value (0.045)?
Thanks
This was so great step by step… up until the p value which appeared to be pulled out of thin air… how did you get 0.045? Also I got a negative H value… which I don’t know is valid…
Where is the formula for calculating p value. It is not visible on your screenshots
i have a question. how was the p value calculated? there is no mention of formula and in the screenshot its just the value
Hello Zach.
First I would like to thank you for this tutorial.
In step 3 you showed the formula for the test statistic H and the p-value. Sadly I couldn’t find the formula for the p-value.
I would really appreciate it, if you could send/write me the formula for the p-value, since I’m just starting to learn about statistics and the Kustal-Wallis-Test.
Sincerely
Ina
How did you calculate the P-value? the formula is not shown in the screenshot… besides that, this has worked brilliantly! Thank you!
How did you find the p-value? if there’s an excel formula its greatly appreciated
how did you calculate the p value at the end?
Excellent thank you very much
Thank you!
However. How do I calculate the p-value? It’s not included in the instructions.
Very precise and clear steps…i easily understood the entire process. Thank you
So how did you come up with the value for p?
How to compute P-vlaue? P-value formula?
I tried to the examples given and I was not sure that using the data used in the examples I did not get the same results.
In the formula for calculation of H, 12 was substituted for n instead of 130 that was supposed to be sample size
So I am not so sure I understand the logics very well
Where did the p value come from?
For those who ask, the p-value is from the formula =CHISQ.DIST.RT(H,k-1) where H = 6.204, k-1 = 2
Thank you for your feedback and contribution to our discussion!
Thank you very much!