CV Formula in Excel: How to Calculate Coefficient of Variation
In this article
To calculate the Coefficient of Variation (CV) in Excel, you divide the standard deviation of a data set by its mean (average). Because Excel does not have a built-in "=CV()" function, you must combine two existing functions using the formula =STDEV.P(range)/AVERAGE(range) for a population or =STDEV.S(range)/AVERAGE(range) for a sample. This calculation provides a dimensionless number that allows you to compare the relative variability of two different data sets, even if they use different units of measurement or have vastly different scales.
What You'll Need
- Microsoft Excel (any version from 2010 onwards is recommended for the STDEV.P/S functions).
- A set of numerical data organized in a single column or row.
- Basic understanding of how to select a range of cells.
Step-by-Step
- Organize Your Data: Enter your raw data into a single column. For example, place your values in cells A2 through A21. Ensure there are no text strings or empty cells within this range, as this can sometimes lead to calculation errors or skewed results depending on the function used.
- Calculate the Mean (Average): Click on an empty cell where you want the average to appear (e.g., B2). Type
=AVERAGE(A2:A21)and press Enter. This provides the arithmetic mean, which serves as the denominator in the CV formula. - Calculate the Standard Deviation: Determine if your data represents a whole population or just a sample.
- If you have every single data point for the group you are studying, use the population formula in cell B3:
=STDEV.P(A2:A21). - If your data is a random selection representing a larger group, use the sample formula in cell B3:
=STDEV.S(A2:A21).
- If you have every single data point for the group you are studying, use the population formula in cell B3:
- Apply the CV Formula: In a third cell (e.g., B4), create the final calculation by dividing the result of the standard deviation by the result of the average. Type
=B3/B2and press Enter. - Alternative Single-Cell Method: If you prefer not to have helper cells for the mean and standard deviation, you can nest the functions into one long formula. In an empty cell, type
=STDEV.S(A2:A21)/AVERAGE(A2:A21)and press Enter. This performs both calculations internally and outputs the CV immediately. - Format as a Percentage: The result of a CV calculation is a decimal (e.g., 0.15). To make this more readable, select the cell, go to the Home tab on the ribbon, and click the % (Percent Style) button in the Number group. A result of 0.15 will now display as 15%.
Common Mistakes
One of the most frequent errors is using the wrong standard deviation function. Using STDEV.P (Population) when you actually have a sample will result in an underestimated CV, because the population formula divides by n while the sample formula divides by n-1 to account for bias. Always verify the nature of your data source before choosing the function.
Another common mistake is attempting to calculate the CV for data sets that contain negative numbers or a mix of positive and negative values. Because the CV relies on the mean as the denominator, if the mean is zero or very close to zero, the resulting CV will be mathematically undefined or astronomically high, rendering the metric useless. The CV is specifically designed for ratio-scale data (data with a true zero, like height, weight, or price).
Users also frequently forget to format the final cell as a percentage. While the decimal value is mathematically correct, the Coefficient of Variation is standardly reported as a percentage in scientific and financial reporting to indicate the level of dispersion relative to the mean.
Tips
To make your spreadsheet dynamic, use Named Ranges. Instead of typing A2:A21, highlight your data and type a name like "SalesData" in the Name Box (top left). Your formula then becomes =STDEV.S(SalesData)/AVERAGE(SalesData), which is much easier to read and audit.
If you are comparing multiple groups (e.g., the variability of sales in three different cities), set up a table where each column is a city. Calculate the CV at the bottom of each column. This allows you to see which city has the most consistent performance regardless of the total volume of sales. A lower CV indicates higher consistency (lower relative variability), while a higher CV indicates a more volatile data set.
For those working with very large datasets, consider using Excel Tables (Ctrl+T). When you add new rows to a Table, the formulas referencing those columns update automatically, meaning your CV will recalculate in real-time as you add new data points without needing to manually adjust the range from A21 to A22.
Troubleshooting
If your formula returns a #DIV/0! error, it means the AVERAGE function resulted in zero. Since you cannot divide by zero, Excel throws this error. Check your data for errors or verify if the sum of your values is exactly zero. If the mean is zero, the CV is not a valid metric for that specific data set.
If you see a #VALUE! error, there is likely a non-numeric character (like a space, a letter, or a hidden symbol) within your selected range. Use the =ISNUMBER() function on suspect cells to identify which one is being treated as text. You can also use the Find and Replace tool (Ctrl+H) to remove accidental spaces or characters from your data column.
If the result seems impossibly high (e.g., 5000%), check if your data contains extreme outliers. A single massive value can inflate the standard deviation significantly while only moderately increasing the mean, leading to a very high CV. Consider using a box plot to identify outliers before calculating the CV.
Frequently Asked Questions
What is a "good" CV value?
There is no universal "good" number, as it depends on the field. In some laboratory settings, a CV under 5% is considered highly precise. In social sciences or stock market volatility, a CV of 20% or 30% might be considered low. The value is most useful when compared to another data set.
Can I use the CV for data with negative numbers?
It is not recommended. If the mean is negative, the CV will be negative, which contradicts the purpose of measuring dispersion. If the mean is near zero, the result becomes unstable. Use the standard deviation alone for data that crosses zero.
What is the difference between STDEV.S and STDEV.P?
STDEV.S is for a sample (a subset of the population) and uses n-1 in the denominator to provide an unbiased estimate. STDEV.P is for the entire population and uses n. Use .S unless you are certain you have every single possible data point.
Why doesn't Excel have a built-in CV function?
Because the CV is a simple ratio of two other common statistics (mean and standard deviation), Microsoft provides the building blocks rather than a dedicated function. Combining these two functions allows users to choose whether they need the population or sample version of the calculation.
How does CV differ from Standard Deviation?
Standard deviation is an absolute measure of spread in the same units as the data (e.g., dollars). CV is a relative measure (a percentage). This allows you to compare the volatility of a $10 item to a $10,000 item on equal terms.