Perform a Sign Test in Excel (Step-by-Step)


The Sign Test stands as a cornerstone of statistical analysis, offering a highly versatile and practical non-parametric test. Its core purpose is to rigorously assess whether a given population median is statistically equivalent to a specific, predefined hypothesized value. A major advantage of the Sign Test over traditional parametric alternatives, such as the t-test, is its remarkable robustness. It does not necessitate the restrictive assumption that the underlying data follows a normal distribution, making it an ideal choice for analyzing skewed data sets or situations involving small sample sizes.

This powerful statistical procedure functions by simply comparing the frequency of observations that fall above the specified median against the frequency of observations that fall below it. This methodology is rooted in a straightforward principle: if the true population median genuinely matches the hypothesized value, we should expect approximately half of the recorded data points to be positive (above the median) and half to be negative (below the median).

To demonstrate its application, the following comprehensive, step-by-step guide details the precise methodology required for executing a Sign Test efficiently within Microsoft Excel, using a practical, real-world manufacturing data example.

Step 1: Formulate Hypotheses and Input Raw Data in Excel

The foundational stage of any statistical inference procedure requires the formal definition of the null and alternative hypotheses. For the Sign Test, the analysis centers on evaluating a claim regarding the true population median, denoted by the Greek letter eta (η).

Consider a practical scenario: A manufacturing facility claims that its standard production line yields widgets with a true median weight of 50 pounds (M0 = 50). A quality control inspector collects a random sample of 20 widgets and records their weights to test this assertion. Our objective is to determine if this sample data provides compelling evidence to reject the manufacturer’s claim—specifically, to conclude that the true median weight is significantly different from 50 pounds.

Given that we are testing for a difference (not just greater than or less than), this is a two-sided test. The specific null and alternative hypotheses are formalized as follows:

  • H0 (Null Hypothesis): The population median widget weight is equal to 50 pounds (η = 50).
  • HA (Alternative Hypothesis): The population median widget weight is not equal to 50 pounds (η ≠ 50).

The subsequent step involves accurately transferring the raw weight data collected by the inspector into a dedicated column within Excel. The data setup should mirror the arrangement shown below, preparing the groundwork for the sign calculation:

Step 2: Assigning Signs Using the Excel SIGN Function

The core mechanism of the Sign Test involves transforming the raw quantitative data into simple categorical data based purely on direction relative to the hypothesized median (M0 = 50). For each observation (Xi), we must assign a numerical sign based on whether the data point is above, below, or equal to the hypothesized value.

The classification rule is straightforward and dictates the sign assigned to each widget weight:

  • If Xi < M0 (Weight is less than 50), the sign is -1 (Negative).
  • If Xi = M0 (Weight is exactly 50), the sign is 0 (Zero).
  • If Xi > M0 (Weight is greater than 50), the sign is 1 (Positive).

It is standard statistical practice to exclude any observations that fall exactly on the hypothesized median (those assigned a 0 sign). These ‘ties’ provide no directional information regarding the null hypothesis and are therefore removed, resulting in the calculation of the effective sample size (n), which includes only the non-zero signs (the 1s and -1s).

In Excel, this transformation is efficiently handled by utilizing the built-in SIGN function. By placing the following formula in a new column (e.g., cell C2) and dragging it down, we automatically calculate the sign for every data point:

=SIGN(A2-50)

This formula first computes the difference between the observed weight (A2) and the hypothesized median (50). It then returns the sign of that resultant difference, flawlessly implementing the classification rules detailed above. The completed calculation column, demonstrating the assigned signs for the entire dataset, is depicted below:

We have now successfully quantified the direction of deviation for all sampled widgets, distinguishing between those heavier than 50 lbs (positive signs) and those lighter than 50 lbs (negative signs).

Step 3: Calculating the Test Statistic and Determining the P-Value

Under the premise of the null hypothesis (H0: η = 50), the Sign Test relies on the principle that there is an equal likelihood (p = 0.5) of observing either a positive sign or a negative sign. Consequently, the count of positive signs (or negative signs) within our effective sample size (n) follows a binomial distribution with parameters n and p = 0.5.

Our first task is to use the COUNTIF function in Excel to summarize the directional data calculated in Step 2:

  • Total Positive Signs (S+): This is the count of all ‘1’ values, representing widgets heavier than 50 lbs.
  • Total Negative Signs (S-): This is the count of all ‘-1’ values, representing widgets lighter than 50 lbs.
  • Effective Sample Size (n): This is the sum of S+ and S-. Crucially, this variable excludes any zero signs, ensuring only relevant observations contribute to the test power.

The Test Statistic (S) for the Sign Test is defined as the smaller value between the positive count (S+) and the negative count (S-). This selection is vital because the subsequent p-value calculation uses the cumulative probability of this smaller count, which naturally calculates the one-tailed probability of observing a deviation as extreme as the one measured.

The p-value is the probability of obtaining a test result as extreme as, or more extreme than, the result observed in the sample, assuming H0 is true. In Excel, the calculation of this cumulative binomial probability is handled efficiently by the BINOM.DIST function, which takes the general form:

=BINOM.DIST(Test Statistic S, Effective Sample Size n, Probability p, Cumulative)

We set the last argument to TRUE because we require the cumulative probability (P[X ≤ S]). Since our hypothesis test is two-sided (HA: η ≠ 50), we must multiply the resulting cumulative probability by two to account for both tails of the distribution.

The summary of these calculations, including the resulting p-value, is displayed below:

The specific Excel formulas used to derive these final statistics are:

  1. Total Positive Signs: =COUNTIF(C2:C21, 1)
  2. Total Negative Signs: =COUNTIF(C2:C21, -1)
  3. Effective Sample Size (n): =D2+D3
  4. Test Statistic (S): =MIN(D2, D3) (Always selecting the smaller count)
  5. P-Value Calculation: =2 * BINOM.DIST(D5, D4, 0.5, TRUE)

The final computed p-value represents the statistical likelihood of observing a distribution of signs as skewed or more extreme than the one measured, assuming the true population median is indeed 50 pounds.

Step 4: Interpreting Results and Stating the Conclusion

The interpretation phase of the Sign Test involves comparing the resulting p-value against the predefined significance level (α), which is conventionally set at 0.05. This comparison dictates whether we accept or reject the premise established by the null hypothesis. The decision rule is fundamentally simple:

  • If P-Value < α: We reject the null hypothesis (H0). This finding provides statistically significant evidence that the population median is, in fact, different from the hypothesized value.
  • If P-Value ≥ α: We fail to reject the null hypothesis (H0). This outcome suggests that the data lacks sufficient statistical power to conclude that the population median differs from the claimed value.

In our manufacturing example, the calculated p-value was 0.0453. When juxtaposed with the standard significance level of α = 0.05, we observe that 0.0453 is less than 0.05. Based on this comparison (P-Value < α), we must reject the null hypothesis.

The statistical conclusion drawn from this analysis is clear: based on the collected sample of 20 widgets, there is compelling evidence to assert that the true median weight of the widgets produced by the manufacturing plant is statistically and significantly different from the claimed 50 pounds. The production process does not meet the 50-pound median standard.

Understanding the Two-Sided Adjustment: It is crucial to grasp why the final cumulative probability from the BINOM.DIST function is doubled. Because our alternative hypothesis (HA: η ≠ 50) tests for deviations in either direction (above or below), we conduct a two-sided test. The Excel BINOM.DIST function naturally calculates a one-tailed probability (the chance of getting S or fewer extreme results). By multiplying this result by two, we correctly account for the probability of observing an equally extreme result in the opposite tail of the distribution, thus ensuring the p-value is appropriate for the two-tailed test structure.

Exploring Other Non-Parametric Alternatives

The Sign Test serves as an excellent introduction to the flexibility and utility of non-parametric methods. These robust techniques are indispensable tools in statistical research, particularly when the rigid distributional assumptions required by parametric tests (like normality) cannot be justified or met by the data.

Depending on the specific structure of your experimental design and the nature of your data, alternative non-parametric tests performed in Excel might be more appropriate. These tests address different research questions while still avoiding reliance on distributional assumptions.

We recommend exploring the following related statistical tutorials to broaden your non-parametric analysis toolkit:

  • Wilcoxon Signed-Rank Test: This test is preferred over the Sign Test when the data is symmetric around the median, as it utilizes magnitude information, making it generally more powerful.
  • Mann-Whitney U Test: This is the non-parametric equivalent used specifically for comparing the medians of two independent groups.
  • Kruskal-Wallis H Test: This method extends the Mann-Whitney U Test to scenarios involving the comparison of medians across three or more independent groups.

Cite this article

Mohammed looti (2025). Perform a Sign Test in Excel (Step-by-Step). PSYCHOLOGICAL STATISTICS. Retrieved from https://statistics.arabpsychology.com/perform-a-sign-test-in-excel-step-by-step/

Mohammed looti. "Perform a Sign Test in Excel (Step-by-Step)." PSYCHOLOGICAL STATISTICS, 3 Nov. 2025, https://statistics.arabpsychology.com/perform-a-sign-test-in-excel-step-by-step/.

Mohammed looti. "Perform a Sign Test in Excel (Step-by-Step)." PSYCHOLOGICAL STATISTICS, 2025. https://statistics.arabpsychology.com/perform-a-sign-test-in-excel-step-by-step/.

Mohammed looti (2025) 'Perform a Sign Test in Excel (Step-by-Step)', PSYCHOLOGICAL STATISTICS. Available at: https://statistics.arabpsychology.com/perform-a-sign-test-in-excel-step-by-step/.

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

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

Download Post (.PDF)
Scroll to Top