How to Fix Excel Correlation Coefficient #DIV/0! Error
Question details
The user needs to fix a #DIV/0! error that occurs when using Excel's correlation coefficient formula on population data.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating the statistical correlation coefficient between two arrays of population data.
- Observed behavior
- The formula returns a #DIV/0! divide-by-zero error instead of the expected correlation value, likely caused by data formatted as text, mismatched array lengths, missing values, or an array with zero variance.
Before troubleshooting the formula, double-check that both data arrays selected in your CORREL or PEARSON function have the exact same number of data points.
Convert Text-Formatted Numbers to Valid Numeric Values
Data imported from other software or pasted from the web is often stored as text. Excel ignores text in statistical calculations, which leads to a zero denominator and triggers the #DIV/0! error.
The CORREL function requires purely numerical data to calculate the standard deviations of the arrays. If an entire array is stored as text, Excel treats its variance as zero. Dividing by zero is mathematically impossible, hence the error.
Click and drag to select the cells in both data arrays used in your correlation formula.
Look for a small green triangle in the top-left corner of the cells. Click the yellow warning icon that appears next to the selection and choose 'Convert to Number' from the dropdown menu.
If the warning icon does not appear, keep the column selected, navigate to the 'Data' tab on the top ribbon, click 'Text to Columns', and immediately click 'Finish' to force Excel to re-evaluate the column as numbers.

Identify and Handle Zero Variance in Data Arrays
A correlation coefficient measures how two variables change together. If one of the variables never changes, the formula fails.
Remove Blank Cells and Mismatched Rows
Empty cells or misaligned data pairs can disrupt the paired calculation process of the correlation function.
Calculate Correlation Coefficients Easily in WPS Spreadsheet
WPS Spreadsheet offers powerful, highly compatible statistical functions including CORREL and PEARSON. It features intuitive error-checking tools that quickly help you spot text-formatted numbers and blank cells, ensuring your population data analysis is accurate and error-free.
- 1. Open your dataset: Launch WPS Spreadsheet and open the workbook containing the population data you wish to analyze.
- 2. Select the function: Click on the cell where you want the result, navigate to the 'Formulas' tab, click 'Insert Function', and select the 'CORREL' function.
- 3. Input the data ranges: In the function dialog, highlight your first numerical data column for Array1 and your second numerical data column for Array2.
- 4. Calculate: Click 'OK' or press Enter. WPS Spreadsheet will instantly calculate the correlation coefficient and alert you if data formatting issues are present.

Frequently Asked Questions
Why does the CORREL function return #DIV/0! when my data looks like normal numbers?
Even if data visually looks like numbers, Excel might be storing them as text, especially if the data was imported from a CSV or external database. Text values are evaluated as zero in statistical formulas, causing the denominator to become zero. You must convert these text cells to numeric formats.
Can I hide the #DIV/0! error if I know the correlation cannot be calculated?
Yes. You can wrap your formula in the IFERROR function to display a custom message or a blank cell instead of the error. For example: =IFERROR(CORREL(A2:A10, B2:B10), "Invalid Data").
Does standard deviation relate to the correlation #DIV/0! error?
Yes, directly. The mathematical formula for correlation involves dividing by the standard deviation of both data sets. If a data set consists of the exact same number repeated with no variation, its standard deviation is zero, resulting in a #DIV/0! error.




