Coefficient of Variation in Excel: Step-by-Step
In this article
The coefficient of variation (CV) is the standard deviation divided by the mean, usually shown as a percentage. In Excel there is no built-in CV function, but you can calculate it in one cell with =STDEV.S(range)/AVERAGE(range) and format the result as a percentage. That single formula is enough for most work; the rest of this guide covers the sample versus population choice, a worked example, and the fixes for the usual errors.
What You'll Need
- Excel on desktop (Windows or Mac), Excel for the web, or Excel on mobile — the functions below all exist in current versions.
- Your numbers in one continuous column or row, with no text or blanks mixed in.
- At least two data points for a sample CV, or one for a population CV.
- A separate cell where the result will go, so the formula does not overwrite your data.
Step-by-Step
- Lay out your data. Put each value in its own cell in a single column, for example A2:A11 for ten readings. Leave the header in A1 as text. A continuous range prevents the formula from silently ignoring or misreading cells.
- Decide sample or population. Use the sample version if your numbers are a subset of a larger group, which is the usual case for measurements, test runs or daily figures. Use the population version only when you genuinely have every value in the group, such as all twelve months of a completed year.
- Enter the sample formula. Click the result cell and type
=STDEV.S(A2:A11)/AVERAGE(A2:A11), then press Enter. STDEV.S returns the sample standard deviation, AVERAGE returns the mean, and the division gives the ratio. - Or enter the population formula. If you are working with a full population, use
=STDEV.P(A2:A11)/AVERAGE(A2:A11). The only difference is the function name at the start. - Format as a percentage. Select the result cell, go to the Home tab, and click the percent style button, then add decimal places with the increase-decimal button next to it. Two decimals is a sensible default. The underlying value stays a decimal; only the display changes.
- Multiply by 100 only if you skip percent formatting. If you would rather see a plain number, write
=STDEV.S(A2:A11)/AVERAGE(A2:A11)*100. Do not do both, or you will show 1548% instead of 15.48%. - Check the result against the inputs. In two spare cells enter
=AVERAGE(A2:A11)and=STDEV.S(A2:A11), then confirm that dividing the second by the first reproduces your CV. This catches a mistyped range quickly. - Make it reusable. If you compare several groups, put the range reference in a cell or build the formula once and copy it across columns with relative references. For a whole data table, an absolute reference such as
=STDEV.S($B$2:$B$11)/AVERAGE($B$2:$B$11)keeps the range fixed while you fill down. - Label the cell clearly. Write "CV (sample, %)" beside the result so anyone reading the sheet knows which version was used and in what units.
Worked Example
Suppose A2:A6 holds 20, 22, 19, 21 and 23. The mean is 21 and the sample standard deviation is about 1.58. Dividing gives roughly 0.0753, which formats as 7.53%. The population version gives about 6.80% because STDEV.P divides by the count rather than the count minus one. For a set this small the gap matters; for large data sets it shrinks toward nothing. Either way, the CV expresses spread as a share of the average, which is why it lets you compare a data set averaging 21 with one averaging 2,100 on the same footing.
Common Mistakes
- Mixing sample and population functions. STDEV.S and STDEV.P give different answers. Pick one, use it everywhere in the sheet, and say which in the label.
- Doubling the percentage. Multiplying by 100 and applying percent formatting converts 0.0753 into 753%. Use one method only.
- Leaving text or blanks in the range. Excel ignores text and empty cells in AVERAGE and STDEV, but a zero typed in place of a blank will drag the mean down and distort the ratio.
- Using the CV when the mean can be zero or negative. With a mean at or near zero the ratio explodes, and with a negative mean the CV becomes meaningless. In those cases report the standard deviation instead.
- Comparing CVs across different units without saying so. The CV is unitless, which is its strength, but the comparison only makes sense when the underlying quantities are genuinely comparable.
- Hard-coding numbers in the formula. Typed constants cannot be checked and will not update. Always reference cells.
Tips
- Name your data range with the Name Box, then write
=STDEV.S(Sales)/AVERAGE(Sales)for a formula that reads clearly. - Use
IFERRORto avoid a scary error when the mean is zero:=IFERROR(STDEV.S(A2:A11)/AVERAGE(A2:A11),"n/a"). - Apply the same formula layout in a small helper column, then build a chart of CVs to spot which group is most variable at a glance.
- For a quick single-value check, the Analysis ToolPak's Descriptive Statistics tool reports the mean and standard deviation side by side, which you can divide yourself. It is available on desktop Excel via the Data Analysis button; the web and mobile versions do not include it.
- Keep the raw numbers and the CV in separate cells. Reporting spread without the mean leaves readers unable to sanity-check the figure.
Troubleshooting
You see #DIV/0!. The mean is zero, usually because the range is empty or contains only zeros. Check the range reference first, then confirm the values are numbers rather than text.
You see #VALUE! or #NAME?. A range includes text that cannot be coerced, or the function name is mistyped. STDEV.S uses a period, not an underscore, and older files saved in an old format may not recognise the newer names. Switch to STDEV for the sample version in that case.
The answer looks far too large. You have almost certainly multiplied by 100 and applied percent formatting, or the range is picking up a header row. Remove the extra multiplication or start the range below the header.
The answer looks too small. You may have entered a decimal ratio and expected a percentage, or selected only part of the data. Widen the range and format as a percent.
The formula works on one row but not the next. Relative references have shifted. Lock the range with dollar signs before copying.
Numbers were edited and the CV did not change. Confirm the result cell contains a formula rather than a value pasted in, and that calculation is set to automatic under the Formulas tab.
Frequently Asked Questions
Is there a direct coefficient of variation function in Excel?
No. You calculate it as standard deviation divided by the mean, using STDEV.S or STDEV.P together with AVERAGE.
Should I use STDEV.S or STDEV.P for the CV?
Use STDEV.S when your data is a sample of a larger group, which covers most practical cases. Use STDEV.P only when you have the complete set of values.
Why is my CV over 100%?
That is possible and not automatically an error: it means the standard deviation exceeds the mean. It often signals highly variable data or a mean close to zero. Check for a missing multiplication or a stray header before assuming the calculation is wrong.
Can the coefficient of variation be negative?
No, provided the mean is positive, because standard deviation is never negative. If the mean is negative the ratio turns negative and the CV loses its usual meaning, so report the standard deviation instead.
Can I calculate the CV in Excel for the web or on my phone?
Yes. STDEV.S, STDEV.P and AVERAGE work in Excel for the web and the mobile apps. Only the desktop Data Analysis add-in is missing there.