Struggling to test for normality or compare distributions in your thesis? The Kolmogorov-Smirnov Test is a reliable solution. While Excel lacks a built-in option, you can still perform it with ease.
The Kolmogorov-Smirnov test definition is easy: it assesses how closely your data aligns with a chosen distribution. It is a nonparametric test of normality that compares the shape of your data distribution with a theoretical distribution selected. Such as the normal or uniform distribution.
At Affordable Dissertation UK, we understand how challenging it can be to apply complex statistical tests correctly during thesis writing. This guide will walk you through everything you need to know. From preparing your dataset in Excel, applying formulas, to understanding the KS test p-value interpretation, you will gain clarity and confidence in reporting results.
What is the K-S Test’s Purpose?
The Kolmogorov-Smirnov Test is widely used in research. Its primary purpose is to test the goodness-of-fit KS test, which checks how well your sample matches a specific distribution. Unlike some methods that require normality assumptions, this test is flexible and effective. The one-sample KS test is the most common version.
It compares your data to a theoretical distribution, such as a normal, uniform, or exponential one.
For example, in thesis research, you should check if exam scores follow a normal curve. The one-sample approach allows you to make that comparison quickly.
The two-sample KS test works differently. Instead of comparing against a theoretical curve, it checks whether two independent samples come from the same distribution. For instance, you might test if a treatment group and a control group share similar patterns. If their distributions differ, the test will highlight it. Both versions rely on the same idea.
They measure the maximum difference between the empirical distribution function (EDF) test of your sample and the cumulative distribution function (CDF) in the KS test of the theoretical or second sample. That difference is called the KS statistic (D statistic), which forms the core of the test.

Key Assumptions to Know
The KS test in statistics is a nonparametric test of normality. This means it does not assume that your data follows a specific distribution. That flexibility is one reason it is so popular in academic research. However, there are still important assumptions about the KS test.
The most critical one is that your data must be continuous. The test performs poorly with discrete values or datasets containing many ties.
For example, if several participants have identical scores, the KS statistic may become less reliable. Another assumption relates to sample size. While the test can work on small datasets, it becomes more robust as the sample grows.
Many researchers recommend having more than 30 observations. Larger datasets produce more stable and meaningful results.
Common Applications in Thesis Research
In thesis research, the Kolmogorov-Smirnov Test appears in many situations. Here are three of the most frequent applications:
- Testing for Normality: This is the most common case. For example, before applying a parametric test like a t-test, you need to check if your data is normally distributed. The KS test for normality allows you to confirm whether your assumption holds. If it fails, you may need to use a nonparametric alternative.
- Pre-test for Parametric Tests: Many statistical tools, such as ANOVA or regression, assume that the data are normally distributed. Using the goodness-of-fit KS test helps determine whether you can apply these methods. If your data violates the assumption, you should either transform the data or select an alternative test.
- Comparing Samples: Another practical use is the two-sample KS test. Suppose you are evaluating whether students taught with two different teaching methods perform similarly. By running this test, you can check if their score distributions match or differ significantly.

To conclude, the Kolmogorov-Smirnov test is particularly useful for examining the characteristics of a distribution and is therefore a versatile instrument for such investigations. It serves a single purpose: does the data act as expected, regardless of whether there is one or two datasets?
This utility is precisely why it is applied, useful, and employed in sophisticated research initiatives in finance, data science, or even the social sciences.
Organising Your Dataset
Any datasets should be neatly arranged before running the KS test in Excel. For Excel to compute its formulas efficiently, every value should be entered in separate rows of a given column. Avoid separating data into multiple rows or columns. It will make the analysis complex. Use a meaningful nomenclature to label your columns.
For instance, use titles such as “Sample A” and “Sample B.” In this way, you can recognise which dataset is for which test. If you are running a one-sample KS test, you may only need one column of data. For a two-sample KS test, keep both datasets side by side in two labelled columns. Clear labelling prevents errors later and makes your results easy to present in a thesis.

Essential Data Cleaning
Data cleaning is one of the most important steps before applying the Kolmogorov-Smirnov Test. Remove blanks, text values, and non-numeric characters. Even a single stray text value can break your formula in Excel.
You should also check for outliers. Extreme values can distort the KS statistic (D statistic) and change the outcome. While the goodness-of-fit KS test is robust, highly skewed data may still affect the interpretation of the KS test p-value. If you identify outliers, determine whether to retain them based on your research context. Always document your choice in the methodology section.
Sample Size and Formatting
Sample size matters in the KS test in statistics. While the test can work with small datasets, larger samples usually give more reliable results. A general rule is to aim for n > 30. This ensures more accurate comparisons between the empirical distribution function (EDF) test and the cumulative distribution function (CDF) in the KS test.
Formatting your numbers in Excel is another small but essential step. Make sure all entries are in numeric format. Sometimes Excel treats numbers as text, which prevents formulas from working correctly. Apply number formatting through the toolbar to confirm that every entry is recognised as a value.
Good formatting also ensures your final output, such as the KS statistic, is clean and error-free. This is especially helpful when presenting your work in academic writing or research reports. In summary, organising, cleaning, and formatting your data is not optional. These steps form the foundation for accurate results when running the Kolmogorov-Smirnov Test in Excel.
Why Excel Is Challenging: No Built-in Function
If you’ve used Excel for data analysis, you know how convenient built-in functions can be. Need a t-test? Excel has you covered. Want a regression? Just a few clicks. Unfortunately, when it comes to the Kolmogorov-Smirnov Test, Excel does not provide a ready-made function. This is the biggest challenge for students and researchers.
You cannot simply select your data and press a button. Instead, you need to follow a manual process to calculate the KS statistic (D statistic) and interpret the results. At first, this might sound intimidating. However, the process is logical and straightforward once broken into steps.
With patience and careful setup, you can successfully run the KS test in Excel without needing expensive software like SPSS, R, or Python.
The Manual Method: Calculating the D-statistic and P-value
Here is the complete step-by-step process:
Step 1: Sort Your Data
Start by organising your dataset. Select your data column in Excel. Then click on the Sort & Filter option from the Data tab. Choose “Sort Smallest to Largest.” Sorting is critical because the empirical distribution function (EDF) test relies on ordered data. If your data is not sorted, the next steps will give incorrect results.

Step 2: Calculate the Empirical Cumulative Distribution Function (ECDF)
The ECDF shows how your sample data accumulates from the smallest to the largest values. It basically tells you the proportion of observations less than or equal to a given value. In Excel, use this formula:
=RANK.AVG(A2, A$2:A$50, 1) / COUNT(A$2:A$50)
Here’s what each part means:
- RANK.AVG(A2, A$2:A$50, 1) ranks the current value in your dataset.
- COUNT(A$2:A$50) counts the total number of data points.
- Dividing the rank by the count converts it into a cumulative proportion.
Repeat this formula for each row in your dataset. You now have the empirical distribution function values for all data points, as shown in the Figure.

Step 3: Calculate the Theoretical CDF
Next, compare your data to a theoretical distribution. In most cases, you will test for normality. This means you need the sample mean and standard deviation first. Use Excel’s
=AVERAGE (A2:A50) and =STDEV.S(A2:A50) functions.
Replace “mean” and “stdev” with the actual cell references containing your calculated values. The result provides the theoretical cumulative distribution function (CDF) for each observation in the KS test. If you want to test against another distribution, such as a uniform or exponential distribution, you can replace NORM.DIST with the appropriate function. For example:
- KS test for uniform distribution: use simple scaling.
- KS test for exponential distribution: use =EXPON.DIST.

Step 4: Find the Absolute Difference
Now, calculate the absolute difference between the ECDF and the theoretical CDF. This step measures how far your data deviates from the chosen distribution. Use this formula:
=ABS(G2-E2)
Here, G2 is your ECDF value, and C2 is your theoretical CDF value. Copy this formula down for the entire dataset. These differences are crucial. They form the basis for the KS statistic (D statistic).

Step 5: Find the D-statistic
The KS statistic is simply the maximum of these absolute differences. It captures the single largest gap between the observed and expected distributions. In Excel, calculate it with:
=MAX (H2:H50)
The result is your KS statistic. This number alone does not give you the answer. You need to compare it against either a critical value or calculate a p-value.

Step 6: Determine the Critical Value or P-value
This final step is where interpretation happens. You have two main options:
Method A: Use Critical Values.
Critical values for the goodness-of-fit KS test depend on your sample size (N) and chosen significance level (α, usually 0.05). You can find these in published tables. For example, if N = 50 and α = 0.05, look up the table and find the corresponding critical value. If your KS statistic is larger than the critical value, you reject the KS test null hypothesis. This means your data does not follow the specified distribution.
Method B: Use a P-value:
P-values provide a more direct interpretation. Unfortunately, Excel does not calculate them for the Kolmogorov-Smirnov Test. You can use two alternatives:
- A reliable online calculator that allows you to input your KS statistic and sample size.
- An Excel add-in designed for advanced statistics.
P-values are more flexible than critical values. If your KS test p-value interpretation is less than 0.05, you reject the null hypothesis. If it is greater than 0.05, you fail to deny it. Many researchers prefer the p-value method because it provides more nuanced insights. However, both methods are valid.

Wrapping up Section 3
Running the KS test in Excel may seem like extra work, but it’s very doable. By sorting your data, calculating the empirical distribution function, comparing it with the theoretical cumulative distribution function, and finding the KS statistic, you gain a powerful method for distribution testing. Whether you use critical values or p-values, the result helps answer a key research question: Does your data fit the expected distribution? With these steps, you can perform the Kolmogorov-Smirnov Test confidently, even in Excel.
Interpreting and Reporting Your Findings
The Decision Rule
Once you calculate the KS statistic (D statistic), the next step is interpretation. In the Kolmogorov-Smirnov Test, you always begin with two competing ideas.
- Null Hypothesis (H0): The sample is drawn from the specified distribution, such as the normal distribution.
- Alternative Hypothesis (HA): The sample is not drawn from that distribution.
Your decision depends on comparing the KS statistic with the KS test critical values or by interpreting the KS test p-value.
- If the D statistic > Critical Value, or if the p-value < 0.05, reject the null hypothesis. This means your data is not normally distributed.
- If the D statistic < Critical Value, or if the p-value > 0.05, you fail to reject the null. This means your data is likely normally distributed.
This simple rule helps researchers decide whether parametric methods are appropriate for further analysis.
Presenting Results in Your Thesis
Clarity is essential when reporting results. Most students present both the KS statistic and the p-value in a small, professional table. For example:
| Test | D statistic | p-value | Result |
| Kolmogorov-Smirnov | 0.15 | 0.01 | Reject H0 |
Tables like this make it easy for examiners to review your findings. After the table, write one clear sentence summarising your results. For instance: “The Kolmogorov-Smirnov Test indicated that the data was not normally distributed (D = 0.15, p < 0.01).” Keep the language simple. Avoid long explanations. Direct reporting adds credibility to your thesis.
Need help applying statistical methods correctly or presenting your analysis in your thesis? Explore our dissertation writing services and get expert support from academic professionals.
When the K-S Test is Not the Right Choice
Limitations of the K-S Test
The Kolmogorov-Smirnov Test is a valuable tool, but it is not perfect. There are several important limitations to the KS test that every researcher should be aware of. First, the test struggles with tied values. When many data points share the same value, the accuracy of the test decreases.
This often occurs in rounded measurements or categorical data. Second, the test is designed for continuous data. If your dataset is discrete, such as count data, the results are less reliable. The test may suggest a poor fit even when the model is reasonable. Third, the test lacks power in certain situations.
Compared with other normality tests, the K-S test is weaker. It can fail to detect differences, especially with small sample sizes. This can lead to a false sense of normality. These limitations do not make the K-S test useless. However, they remind us to use it carefully, especially in thesis work, where accuracy is crucial.
| Advantages of Kolmogorov-Smirnov Test | Drawbacks of the Kolmogorov-Smirnov Test |
| Nonparametric test of normality does not assume a specific distribution. | Less powerful than alternatives like the Shapiro-Wilk test, especially with small samples. |
| Works for both the one-sample and two-sample Kolmogorov-Smirnov tests. | Sensitive to ties and discrete data, leading to unreliable results. |
| Provides a simple goodness-of-fit KS test for comparing data to a theoretical distribution. | Requires continuous data for accuracy; not suitable for categorical variables. |
| Can test data against different distributions (normal, uniform, exponential). | Interpretation depends on the KS test critical values or external calculators for p-values. |
| Widely implemented in tools like R, Python (SciPy), SPSS, and Excel (manual method). | Less accurate with large sample sizes, where small deviations may appear significant. |
| Useful in applied fields such as data science, financial risk modelling, and machine learning models. | Limited insight into where differences occur only highlights the maximum deviation. |
Better Alternatives to the K-S Test for Normality
When normality testing is essential, consider better alternatives. The most trusted option is the Shapiro-Wilk Test. Many statisticians call it the gold standard for testing normality. It is especially powerful with small sample sizes (n < 50). Unlike the K-S test, it is more sensitive to departures from normality. Another strong option is the Anderson-Darling Test. This test gives more weight to the tails of a distribution.
Many researchers find it helpful when extreme values matter. Both tests are widely available in statistical software like R, SPSS, and Python. Unlike Excel, these programs include built-in commands for these tests. Running them is simple, and the output is straightforward. For most thesis projects, the Shapiro-Wilk Test is the safest choice. It provides a stronger foundation for deciding whether to use parametric tests.
The Anderson-Darling Test is also an excellent option if you want to double-check your results. In summary, the Kolmogorov-Smirnov Test is a useful starting point. But for robust research, alternatives like Shapiro-Wilk or Anderson-Darling often provide better insights. Now we hope you understand the difference between the KS test and the Shapiro-Wilk test.
| Software | Role of KS Test |
| KS test in R | ks.test() function allows one-sample and two-sample KS testing for distribution comparison. |
| KS test in Python (SciPy) | scipy.stats.ks_1samp and ks_2samp functions perform KS testing for normality and sample comparison. |
| KS test in SPSS | Available under Nonparametric Tests → 1-Sample K-S, making it easy to test normality. |
| KS test in Excel | Can be applied manually by calculating ECDF, theoretical CDF, D-statistic, and p-value with formulas or add-ins. |
Best Practices for Robust Analysis
Visualise Your Data First
Before running any statistical test, always visualise your data. Graphs give an instant sense of your dataset’s shape. A histogram is the simplest starting point. It shows the distribution clearly and helps spot skewness or outliers. Another valuable tool is the Q-Q plot (quantile-quantile plot).
This chart compares your sample’s quantiles with those of a theoretical distribution, such as the normal distribution. If the data points fall roughly on a straight line, normality is reasonable. If they deviate strongly, your data may not be normal.
These visual checks often reveal issues that numbers alone might hide. Always combine visualisation with statistical tests for the best results.

Cross-Verification
Excel can handle the Kolmogorov-Smirnov Test, but it has limits. The lack of a built-in function means the process is manual. Errors can easily creep in if formulas are misapplied. For this reason, always perform cross-verification. If possible, re-run the same analysis in a dedicated statistical program.
Options include SPSS, R, Python, or Minitab. These tools have built-in commands for the K-S test and alternatives like the Shapiro-Wilk. This step ensures your findings are reliable. Cross-checking builds confidence and protects you from reporting flawed results. It also demonstrates thoroughness in your thesis work.
Document Everything
Good research is transparent and reproducible. At each step, always document your process. In Excel, this is done by noting every formula applied. For instance, document the precise formulas applied to ECDF, CDF, and the D-statistic. While writing your methodology section, clearly explain the steps. Document how you prepared the data, treated the outliers, and applied the formulas.
Transparency makes it easy for readers to comprehend your choices, and others can reproduce your work. Good documentation also makes you credible. Examiners typically look for whether the statistical process is traceable and rational. By documenting each step, you demonstrate professionalism and vigilance.
In general, sound analysis incorporates visual verification, cross-checking, and careful documentation. These methods ensure your use of the K-S Test in Excel is rigorous and trustworthy. These methods also strengthen your thesis and make it more defensible.
| Field | Use of KS Test |
| KS test in data science | Used to check whether datasets follow assumed distributions before modelling, ensuring accurate statistical analysis. |
| KS test in machine learning models | Evaluates model calibration by comparing predicted probability distributions with observed outcomes. |
| KS test in financial risk models | Validates credit risk models and checks if predicted risk scores align with actual default data. |
Conclusion
To sum up, the Klemogorov-Smirnov Test is not easy to do in Excel. However, it can be handled with the appropriate measures. You start with sorting data and follow with the calculation of the Empirical Cumulative Distribution Function (ECDF). The second step is to compare it and the theoretical CDF and identify the absolute differences.
In the end, you will get a d-statistic value, which can be further interpreted based on the critical or p-value. By following the instructions of this Blog, you have gained insights about both practical advantages and possible limitations of this test.
However, with this guided Blog, you will surely be able to conduct a K-S test for your sample data and draw meaningful results for your thesis topic.
Let an experienced dissertation helper guide you step-by-step toward a well-written, submission-ready thesis.
FAQs
What does the Kolmogorov-Smirnov test measure?
The K-S test measures differences between an empirical distribution and a theoretical distribution, or between two samples.
How do you perform a one-sample KS test?
A one-sample KS test compares your sample’s distribution with a theoretical one, like the normal distribution.
What is the difference between a one-sample and a two-sample KS test?
One-sample checks fit a distribution, while two-sample checks compare distributions of two independent groups.
How do you calculate the KS statistic?
The KS statistic (D statistic) is the maximum difference between the sample’s ECDF and the CDF.
What does a significant KS test mean?
A significant result means the data does not follow the tested distribution.
How does the Kolmogorov-Smirnov test check for normality?
It compares the sample’s ECDF to a normal CDF and looks for large differences.
What are the assumptions of the KS test?
The KS test assumptions include continuous data and no excessively tied values.
When should I use the KS test instead of the Shapiro-Wilk?
Use the K-S test with large samples. The Shapiro-Wilk test is better for small samples.
Can the Kolmogorov-Smirnov test be used for large sample sizes?
Yes. The KS test works for large samples, but it becomes sensitive to small differences.
How is the KS test applied in machine learning or data science?
In machine learning, the K-S test validates model assumptions or compares predictive probability distributions.
Cite this article
If you want to cite this source, you can copy and paste the citation or click the Cite this article button to automatically add the citation to our free Citation Generator.
Bailey Shepherd (October 10, 2025). How to Run a Kolmogorov-Smirnov Test in Excel for Your Thesis and When to Avoid It Retrieved May 25, 2026, from https://www.affordable-dissertation.co.uk/blog/2025/10/10/kolmogorov-smirnov-test-in-excel/
Need Your Normality Testing Done in 48 Hours?
Our statisticians run your tests and write your complete results chapter.

