Coefficient of Variation in Excel: Formula Guide
In this article
Excel has no built-in coefficient of variation function, so you calculate it by dividing the standard deviation of your data by its mean, then formatting the result as a percentage. The formula is =STDEV.S(A2:A20)/AVERAGE(A2:A20), where the range covers your numbers. The result tells you how large the spread is relative to the average — a CV of 0.10 (10%) means the data typically varies by about a tenth of its mean, which lets you compare variability across data sets measured in different units or on very different scales. It is most useful for positive data measured on a ratio scale, such as weights, durations, prices or concentrations.
What You'll Need
- Excel on Windows, Mac, or Excel for the web. The statistical functions used here are available in all of them, including Excel 2010 and later desktop versions.
- At least two numeric values per data set. A single number has no standard deviation, so CV is undefined for it.
- Column or row ranges that contain only numbers in the cells you reference — blanks, text or error values will break the calculation.
- A rough idea of whether your data is a sample or the whole population, because that decides between STDEV.S and STDEV.P.
Step-by-Step
- Lay out your data in a single column. Put the numbers for one group in cells A2:A21 (with a label in A1) and a second group, if you have one, in B2:B21. Keeping each data set in its own contiguous range makes every later formula shorter and easier to audit.
- Check for hidden non-numbers. Select the range and look at the status bar at the bottom of the window. If Excel shows a Count that is lower than the number of visible cells, some entries are stored as text — often numbers imported with leading spaces or apostrophes. Delete the apostrophes, trim the spaces, or run Data > Text to Columns on the column to convert them to real numbers.
- Calculate the standard deviation. In an empty cell, type
=STDEV.S(A2:A21)and press Enter. Use STDEV.S when the values are a sample drawn from a larger group, which is the usual case for measurements, timings and prices. Use=STDEV.P(A2:A21)only when the range contains every member of the group you care about. - Calculate the mean. In another free cell, type
=AVERAGE(A2:A21). This is the denominator of the coefficient of variation, so it must not be zero or negative for the result to be meaningful. - Combine them into one formula. In a third cell, type
=STDEV.S(A2:A21)/AVERAGE(A2:A21). This single expression is the coefficient of variation. Referencing the two previous cells instead, as in=C2/D2, is also fine and makes the intermediate numbers visible for checking. - Format the answer as a percentage if you prefer. Select the result cell and press Ctrl+Shift+% on Windows or Cmd+Shift+% on Mac, or use the Home tab's percentage button. The underlying value stays the same; only the display changes. Many analysts report CV as a decimal (0.18) and others as a percent (18%) — pick one convention and stay consistent.
- Repeat for the second data set. If your second group is in B2:B21, the formula becomes
=STDEV.S(B2:B21)/AVERAGE(B2:B21). Put both results side by side in a small summary table with a label column so the comparison is obvious. - Copy the formula down a longer table if needed. If you have many groups listed in rows and each group's values in a separate column, write the formula once and drag the fill handle across or down. Use absolute references such as
$A$2:$A$21when a range must stay fixed while you copy. - Sanity-check the output. A CV near 0 means the values cluster tightly around the mean; a CV above roughly 1 means the standard deviation exceeds the mean and the data is very dispersed. If the number looks absurd, such as millions of percent, the denominator is probably close to zero — inspect the mean cell before trusting the figure.
Common Mistakes
Using the wrong standard deviation function. STDEV.S (sample) and STDEV.P (population) give different numbers, and on small data sets the gap is large. Mixing the two across groups you intend to compare makes the comparison invalid. Decide once whether your data is a sample or a population and apply the same function everywhere.
Including header text in the range. A range like A1:A21 that contains the label "Weight" still works for AVERAGE, because text is ignored, but it changes the effective count and is easy to misread later. Start ranges at the first data row.
Calculating CV on data that crosses zero. If the mean is negative or close to zero — temperature in Celsius, profit and loss, any measurement with an arbitrary zero — the coefficient of variation loses its meaning. A mean of −5 with a standard deviation of 2 gives −0.40, which cannot be interpreted as relative variability. Use a different measure, such as the standard deviation itself, for that kind of data.
Dividing zero-by-zero into a #DIV/0! error. This happens when the range is empty, when every cell is text, or when the values genuinely average to zero. Wrapping the formula in IFERROR, as in =IFERROR(STDEV.S(A2:A21)/AVERAGE(A2:A21),""), hides the error but does not fix it — find out why the mean is zero first.
Forgetting that CV is unitless by design. A CV of 0.15 for measurements in kilograms and a CV of 0.15 for the same data in grams are identical. That is the point of the statistic, but it also means you cannot convert a CV from one unit to another and expect it to change.
Tips
Keep the standard deviation and mean in their own cells next to the CV. When a result surprises you, being able to see both inputs immediately tells you whether the spread or the average is responsible.
Use STDEV.S rather than the older STDEV function. STDEV still exists for compatibility and behaves the same way as STDEV.S, but the dotted version is clearer to anyone reading the sheet later.
For a quick comparison of several groups, put each group's values in adjacent columns and build one summary row with formulas that reference whole ranges. Avoid retyping the same formula for every column.
Pair CV with the actual mean and count in the summary table. A CV of 0.30 on a mean of 2 kilograms is a different practical story from a CV of 0.30 on a mean of 500 kilograms.
If you paste data in from another system, run Data > Text to Columns on the column first. Imported numbers that arrive as text are the most common cause of an unexpected error or an inflated result.
Troubleshooting
You get #DIV/0!. The denominator is zero. Click the AVERAGE cell on its own. If it shows an error too, the range is empty or text-only; if it shows 0, your numbers cancel each other out. Fix the data, not the formula.
You get #VALUE!. One of the referenced cells contains text that Excel cannot coerce, or the range was typed with a wrong separator. Check whether your version uses commas or semicolons between arguments — regional settings change this, and a comma in a semicolon locale produces exactly this error.
The answer is far larger than you expected. Look at the mean. A mean of 0.02 with a standard deviation of 0.05 yields a CV of 2.5, which is mathematically correct but often means the data should not be summarised this way. Consider whether you are using the wrong units or mixing two different populations in one range.
The two groups you are comparing give suspiciously similar results. Confirm both formulas point at the right ranges and that neither has been filled across with the range shifting unexpectedly. Click each cell and read the formula bar.
If that did not work, rebuild the calculation from scratch in three separate cells — standard deviation, mean, then a simple division — instead of one nested formula. Seeing each intermediate value usually reveals the bad range or stray text in seconds.
Frequently Asked Questions
Is there a CV function in Excel?
No. Excel has no dedicated coefficient of variation function. You calculate it as the standard deviation divided by the mean.
Should I use STDEV.S or STDEV.P?
Use STDEV.S when your numbers are a sample of a larger group, which covers most real-world data. Use STDEV.P only when the range is the entire population.
Should the coefficient of variation be a percentage or a decimal?
Either is accepted. The raw formula returns a decimal such as 0.15; formatting the cell as a percentage displays 15%. State which convention you use so readers are not confused.
Can I calculate CV when the mean is negative?
You can compute it, but the result is not meaningful as a measure of relative variability. CV assumes positive data measured on a ratio scale.
Does CV work with only two numbers?
It produces a number, but two values give an extremely unreliable estimate of spread. Treat any CV from a very small sample with caution.
Why does my CV change when I add one more row?
Because both the mean and the standard deviation shift slightly with every new value. Include the new row inside the range in your formula, or the figure will be based on stale data.