Coefficient of Variation: Formula and Examples

By Dr. Zubair Khalid, DVM, MS, PhD ·

Coefficient of Variation: Formula and Examples

The coefficient of variation (CV) measures how large the standard deviation is relative to the mean. It is a unitless number, usually written as a percentage, so you can compare the spread of datasets that use different units or have very different averages. A CV of 7.6% means the typical deviation from the mean is about 7.6% of the mean itself.

Quick Answer

  • The coefficient of variation is the standard deviation divided by the mean, often multiplied by 100 to give a percentage [1][2].
  • It measures relative dispersion, not absolute spread, so it does not depend on the measurement unit [1].
  • A higher CV means more variability relative to the average. A lower CV means the values cluster more tightly around the mean [1].
  • The CV only makes sense for data on a ratio scale with positive values. If the mean is zero or near zero, the CV is undefined or misleading [1][3].
  • In a lab or quality context, CV is a standard way to express measurement precision, and a change of about 10% or more between test values is often treated as meaningful [2].

The Formula

The coefficient of variation is defined as:

$$CV = \frac{\sigma}{\mu}$$

For a sample, you replace the population values with the sample values:

$$CV = \frac{s}{\bar{x}}$$

To express it as a percentage, multiply by 100:

$$CV\% = \frac{s}{\bar{x}} \times 100$$

Each symbol means:

SymbolMeaning
$s$Sample standard deviation
$\bar{x}$Sample mean
$\sigma$Population standard deviation
$\mu$Population mean

The standard deviation and the mean carry the same unit, so the units cancel and the CV is a pure number [1]. That is what makes it useful for comparing a dataset measured in milligrams with one measured in milliliters.

How to Calculate It Step by Step

  1. Collect your values and confirm they are all positive and measured on a ratio scale.
  2. Compute the mean by adding the values and dividing by the count.
  3. Compute the standard deviation. For a sample, use the $n-1$ denominator, which is the unbiased sample variance under the square root [4].
  4. Divide the standard deviation by the mean.
  5. Multiply by 100 if you want a percentage.

If you want to check your arithmetic, the coefficient of variation calculator does steps 2 through 5 for you.

Worked Example

Suppose a lab runs two assays. Dataset A records five measurements on a low-concentration sample, and Dataset B records five measurements on a high-concentration sample. The question is which assay is more variable relative to its own level.

DatasetMeasurements
A45, 48, 50, 52, 55
B170, 185, 200, 215, 230

Dataset A

  • Mean: $\frac{45 + 48 + 50 + 52 + 55}{5} = 50.0000$
  • Sample standard deviation: $s = 3.8079$
  • CV: $\frac{3.8079}{50.0000} = 0.0762$
  • CV as a percentage: $0.0762 \times 100 = 7.6158\%$

Dataset B

  • Mean: $\frac{170 + 185 + 200 + 215 + 230}{5} = 200.0000$
  • Sample standard deviation: $s = 23.7171$
  • CV: $\frac{23.7171}{200.0000} = 0.1186$
  • CV as a percentage: $0.1186 \times 100 = 11.8585\%$

Comparison

Dataset B has the larger standard deviation in absolute terms (23.7171 versus 3.8079), but that alone does not tell you which dataset is more variable. After scaling by the mean, $CV_A = 7.6158\%$ and $CV_B = 11.8585\%$. Dataset B has the higher relative variability, so its measurements are more spread out around their own average.

Here is the same calculation in Python:

import statistics
lab_a = [45, 48, 50, 52, 55]
lab_b = [170, 185, 200, 215, 230]
cv_a = statistics.stdev(lab_a) / statistics.mean(lab_a)
cv_b = statistics.stdev(lab_b) / statistics.mean(lab_b)
print(round(cv_a * 100, 4), round(cv_b * 100, 4))  # 7.6158 11.8585

Output:

7.6158 11.8585

How to Interpret the Result

The CV tells you the size of the standard deviation as a fraction of the mean. A CV of 7.6158% means the standard deviation is about 7.6% of the average value. A CV of 11.8585% means the standard deviation is about 11.9% of the average.

There is no universal cutoff for a "good" CV. What counts as low depends on the field and the measurement. In clinical laboratory work, the CV of a test reflects the methodology, the instrument, and the range of results, and a shift of roughly 10% or more between two values is often treated as significant [2]. In industrial mixing, the CV of a powder blend is compared against a specification to decide whether mixing is complete [5].

When you compare two or more datasets, the CV gives you a common scale. That is the whole point of the measure. If you only compared standard deviations, the dataset with the larger mean would usually look more variable even when its relative spread is smaller.

Doing It in Software

Excel. Excel has no built-in CV function, so you build it from two others. Use AVERAGE(range) for the mean and STDEV.S(range) for the sample standard deviation, then divide. For a percentage, format the cell as a percentage or multiply by 100.

Python. The SciPy function scipy.stats.variation returns the standard deviation divided by the mean [4]. Its ddof argument defaults to 0, which uses the population standard deviation. Many definitions of the CV use the unbiased sample standard deviation, which corresponds to ddof=1 [4]. The function does not take the absolute value of the mean, so it returns a negative value if the mean is negative [4]. The statistics module in the standard library avoids that ambiguity because statistics.stdev uses the $n-1$ denominator.

R. Base R has no dedicated CV function either. Compute it directly from sd(x) / mean(x), where sd uses the $n-1$ denominator.

If you are still getting comfortable with the spread measures that feed into the CV, the guide to measures of variability covers range, variance and standard deviation, and the mean and standard deviation article walks through the two inputs you need here.

Common Mistakes

  • Using the CV when the mean is zero or close to zero. The CV cannot be calculated when the mean is zero, and it becomes misleading when the mean is near zero because small changes in the mean swing the result wildly [1][3]. Fix: check the mean first, and use an absolute spread measure instead.
  • Applying it to data with negative values. The CV is only reasonable for variables that contain only positive values [1]. Fix: confirm the data are on a ratio scale before reporting a CV.
  • Mixing up the population and sample standard deviation. SciPy's variation defaults to ddof=0, while many definitions use ddof=1 [4]. Fix: state which one you used, and use the same one across every dataset you compare.
  • Reading a bigger standard deviation as more variability. A larger standard deviation can simply reflect a larger mean. Fix: scale by the mean before comparing.
  • Treating the CV as a confidence interval. The CV cannot be used to compute confidence intervals for the mean [3]. Fix: use the standard error of the mean for that purpose.
  • Ignoring outliers. The CV is built from the mean and standard deviation, so outliers can distort it [6]. Fix: inspect the data or use a quantile-based alternative such as the interquartile range divided by the median [6].

Limitations

The CV is a ratio, so it inherits the weaknesses of both parts. It is sensitive to outliers because the mean and standard deviation are sensitive to outliers [6]. For skewed distributions, the mean and standard deviation can be hard to interpret, and the CV inherits that difficulty [6]. It also assumes the data sit on a ratio scale, which rules out temperatures in Celsius or Fahrenheit and many index scores.

There is a deeper issue when you compare CVs across traits or conditions. The CV only accounts for the dimension of the varying quantity, not the dimension of the factor generating the variation, so comparison can be inappropriate in some settings [7]. Even when the scale allows a meaningful CV, you should stay aware of the relationship between the mean and the standard deviation in your data before you draw conclusions from the comparison [7].

Frequently Asked Questions

What is the difference between standard deviation and coefficient of variation?

The standard deviation is an absolute measure of spread and keeps the unit of your data. The coefficient of variation divides that standard deviation by the mean, which cancels the units and turns it into a relative measure [1]. Use the standard deviation to describe one dataset in its own units. Use the CV to compare variability across datasets with different units or very different means.

Can the coefficient of variation be negative?

For positive data, no. The standard deviation is non-negative and the mean is positive, so the CV is non-negative. Some software will return a negative value if the mean is negative, because the function does not take the absolute value of the mean [4]. That is a signal that the CV is not the right tool for that data.

What is a good coefficient of variation?

There is no single threshold. Acceptable values depend on the field, the instrument and the range of the measurements [2]. In a lab setting, a CV around a few percent is often considered tight, while a change of about 10% or more between two test values is often treated as significant [2]. Compare your CV against the norms of your own field.

How do I calculate the CV in Excel?

Excel has no dedicated CV function. Enter =STDEV.S(range)/AVERAGE(range) in a cell, then format the result as a percentage if you want the percentage form. STDEV.S uses the $n-1$ denominator, which matches the sample standard deviation used in most CV definitions.

Why does the CV not work when the mean is zero?

Dividing by zero is undefined, so the CV simply cannot be computed when the mean is zero [1]. When the mean is close to zero but not exactly zero, the CV can still be calculated, but it becomes very sensitive to small changes in the mean and can be misleading [1][3]. In that situation, report the standard deviation or another absolute measure instead.

If you want to see how the CV relates to other summary statistics, the sample variance equation explains the variance that sits under the square root, and the coefficient of determination article covers a different unitless measure used to judge model fit.

References

  1. FAQ: What is the coefficient of variation?
  2. Laboratory Medicine Curriculum
  3. Coefficient of Variation
  4. variation, SciPy v1.18.0 Manual
  5. Coefficient of variation - Wikipedia
  6. Arachchige CNPG, Prendergast LA, Staudte RG. (2022). Robust analogs to the coefficient of variation. Journal of applied statistics
  7. Pélabon C, Hilde CH, Einum S, Gamelon M. (2020). On the use of the coefficient of variation to quantify and compare trait variation. Evolution letters

Related Articles