SLOPE function

SLOPE calculates the slope of a linear regression line between two data sets, showing the rate of change between variables.

=SLOPE(known_ys, known_xs)

Generate a SLOPE formula

Describe what you need. The generator will reach for SLOPE where SLOPE is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How SLOPE reads its arguments
known_ysrequiredknown_xsrequiredSLOPE
ArgumentRequiredDescription
known_ysRequiredThe array or range of dependent variable values (Y-axis data). Must contain numeric values; requires at least 2 elements. Blank cells and non-numeric values produce #VALUE! errors.
known_xsRequiredThe array or range of independent variable values (X-axis data). Must contain numeric values, have at least 2 elements, and cannot have all identical values (which would cause a #DIV/0! error).

Returns

Returns a single decimal number representing the slope (rise over run) of the best-fit regression line.

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Calculate conversion efficiency per dollar spent

SpendConversions
50018
80032
120058
60022
150075
=SLOPE(E2:E6,C2:C6)

Result: 0.058

The slope 0.058 means each additional dollar spent generates approximately 0.058 more conversions on average across the campaign set. This tells you the conversion efficiency rate: for every $1,000 spent, you gain roughly 58 conversions.

2. Measure click generation rate per dollar

SpendClicks
500125
800240
1200480
600160
1500615
=SLOPE(D2:D6,C2:C6)

Result: 0.507

The slope 0.507 indicates that for every additional dollar spent, the campaigns generate roughly 0.5 more clicks on average. This shows a strong positive correlation between budget and click volume, meaning spending increases consistently drive higher engagement.

3. Find conversion rate per click

ClicksConversions
12518
24032
48058
16022
61575
=SLOPE(E2:E6,D2:D6)

Result: 0.115

The slope 0.115 reveals that each additional click results in about 0.115 more conversions on average, representing roughly an 11.5% conversion rate per click. This metric helps evaluate campaign quality independent of spending level.

Common errors

Which SLOPE error are you seeing?
SLOPE returned an error#DIV/0!
Ensure your X values contain at least two different numbers. For example, avoid ranges where all spend values are 1000; use data with natural variation like 500, 800, 1200, etc.
#N/A
Verify both ranges contain exactly the same number of cells. For instance, use C2:C6 and E2:E6 (both 5 rows), not C2:C7 and E2:E6 (different lengths).
#VALUE!
Ensure all cells in both ranges contain only numeric values. Remove or convert any text entries; for example, use numeric IDs instead of campaign names in the range.
ErrorWhy it happensHow to fix it
#DIV/0!All values in known_xs are identical, resulting in zero variance and making the slope calculation mathematically impossible (division by zero in the denominator).Ensure your X values contain at least two different numbers. For example, avoid ranges where all spend values are 1000; use data with natural variation like 500, 800, 1200, etc.
#N/AThe known_ys and known_xs arrays have different lengths or incompatible dimensions, preventing SLOPE from pair up the values correctly.Verify both ranges contain exactly the same number of cells. For instance, use C2:C6 and E2:E6 (both 5 rows), not C2:C7 and E2:E6 (different lengths).
#VALUE!One or both arrays contain non-numeric data such as text labels, blank cells, or special characters that cannot be interpreted as numbers.Ensure all cells in both ranges contain only numeric values. Remove or convert any text entries; for example, use numeric IDs instead of campaign names in the range.

Tips and when to use something else

  • SLOPE calculates the best-fit line's steepness; pair it with INTERCEPT to get the complete linear equation (y = slope × x + intercept) for forecasting.
  • For strongly non-linear relationships or ordinal data, SLOPE may not be meaningful; consider using a correlation function to measure association strength instead.
  • A positive slope means Y increases as X increases; a negative slope means Y decreases as X increases—both are valid and common in analysis.
  • To reduce the impact of outliers on SLOPE, review extreme values in your data first; consider removing them if they represent errors rather than genuine trends.

Frequently asked questions

What's the difference between SLOPE and correlation?
SLOPE measures the rate of change (how much Y changes per unit of X) and is expressed in the same units as your data. Correlation measures the strength of the relationship on a scale of –1 to 1 (unitless). You can have a steep slope with weak correlation, or a gentle slope with strong correlation.
Can SLOPE handle negative slopes?
Yes, absolutely. A negative slope means the dependent variable decreases as the independent variable increases. For example, if SLOPE returns –0.05, each unit increase in X causes Y to decrease by 0.05 on average. This is common in inverse relationships like price versus demand.
What's the minimum data needed for SLOPE?
SLOPE requires at least 2 data points (pairs of X and Y values). With exactly 2 points, the slope is always a perfect line connecting them. With more data points, SLOPE calculates a best-fit line using least-squares regression, providing a more robust estimate of the true trend.
How does SLOPE handle outliers in my data?
SLOPE uses least-squares regression, which weights all points equally and can be significantly skewed by a single extreme value. If outliers are a concern, examine your data first and remove clear measurement errors. For data with legitimate outliers, consider using a robust regression method or filtering to a representative subset.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17