Formula Errors

How to Fix Excel Correlation Coefficient #DIV/0! Error

Amos GikundaAmos Gikunda Oct 29, 2026 870 views

Question details

The user needs to fix a #DIV/0! error that occurs when using Excel's correlation coefficient formula on population data.

How to Fix Excel Correlation Coefficient #DIV/0! Error
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 you start

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.

Solution 1Recommended

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.

1
Highlight the problematic data

Click and drag to select the cells in both data arrays used in your correlation formula.

2
Use the error checking smart tag

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.

3
Alternative: Use Text to Columns

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.

Convert Text-Formatted Numbers to Valid Numeric Values
Format Verification: Once converted successfully, numbers will naturally align to the right side of the cells by default, whereas text aligns to the left.
Calculate Correlation Seamlessly

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. 1. Open your dataset: Launch WPS Spreadsheet and open the workbook containing the population data you wish to analyze.
  2. 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. 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. 4. Calculate: Click 'OK' or press Enter. WPS Spreadsheet will instantly calculate the correlation coefficient and alert you if data formatting issues are present.
100% format and formula compatibility with Microsoft Excel (.xlsx)Smart error checking quickly identifies text formatted as numbersFree to use for daily statistical analysis and data processing
microsoft office alternative - wps office

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.