Back to Glossary

Line Of Best Fit

A line of best fit is the straight line that runs closest to a cloud of data points on a scatter plot, showing the overall direction of the relationship between two variables. Analysts use it to describe a trend and to make rough predictions from past data.

From the Money Master HQ dictionary, founded by Shihan Sheriff (FCMA, VP of Finance at Nomod, CFO at Esanjo Ventures). How these definitions are written.

What it means

Imagine plotting advertising spend on one axis and sales on the other, with one dot for each month. The dots will not sit on a perfect line, but they may drift upwards from left to right.

The line of best fit is the single straight line that passes through the middle of that cloud as faithfully as possible. The usual method is called least squares.

It finds the line that makes the total of the squared gaps between each point and the line as small as possible, so that no single point pulls the line too far. Spreadsheets and statistics tools can draw this line in seconds, and it is the foundation of simple linear regression.

The line is written as y = a + bx. The number b is the slope, which says how much y changes for each one-unit increase in x, and the number a is the intercept, which is the predicted value of y when x is zero.

Once you know both, you can estimate y for a new value of x. In business the line supports forecasting, budgeting and cost analysis.

Finance teams use it to split a mixed cost into its fixed and variable parts, to link sales to marketing spend, and to estimate how a change in one driver affects results. The line describes a pattern; it does not prove cause.

It also works only inside the range of data used to build it, so predicting far beyond the observed values is risky, and a handful of unusual points can tilt the line noticeably.

In practice

Real-world examples.

1

Example

A retailer plots monthly advertising spend against sales for two years and fits a line. The slope shows that each extra $1,000 of advertising has been associated with about $3,700 of extra sales, which helps set next year's marketing budget.

2

Example

A factory manager plots machine hours against electricity cost. The intercept of the line estimates the fixed cost of keeping the plant running, and the slope shows the cost of each extra hour.

3

Example

A property analyst plots floor area against sale price for 50 flats in one district. She uses the line to flag a listing priced far above the line as potentially overvalued.

Formula

Calculation

Slope b = sum of (x - mean of x) x (y - mean of y) / sum of (x - mean of x) squared. Intercept a = mean of y - b x mean of x. Suppose advertising spend in $1,000s (x) is 1, 2, 3, 4, 5 and monthly sales in $1,000s (y) are 12, 15, 19, 22, 27. The mean of x is 3 and the mean of y is 95 / 5 = 19. The gaps for x are -2, -1, 0, 1, 2 and for y are -7, -4, 0, 3, 8. The sum of products = 14 + 4 + 0 + 3 + 16 = 37 and the sum of squared x gaps = 4 + 1 + 0 + 1 + 4 = 10, so b = 37 / 10 = 3.7. Then a = 19 - 3.7 x 3 = 19 - 11.1 = 7.9. The line is y = 7.9 + 3.7x, so spending $6,000 predicts sales of 7.9 + 3.7 x 6 = 7.9 + 22.2 = 30.1, or $30,100.

Case study

Seen in the real world.

Cedarpoint Software is an illustrative, fictional company that wanted to predict its support costs as its customer base grew. The finance analyst plotted the number of customers against monthly support cost for the previous 24 months and fitted a line of best fit.

The line showed a fixed element of about $20,000 a month and a variable element of roughly $4 per customer. The analyst used it to estimate that adding 5,000 customers would add about $20,000 to monthly costs.

When the real figure for the next quarter came in close to the forecast, the board adopted the method for other cost lines. In this illustrative case the analyst also warned that the line should be rebuilt each year, since changes in staffing and tools can alter the relationship.

Watch out

Common mistakes.

  • Treating the line as proof of cause, when two variables can move together because of a third factor.
  • Extending the line far beyond the observed data, where the relationship may no longer hold.
  • Ignoring outliers, which can pull the line away from the pattern the rest of the data shows.

Questions

People also ask.

Does the line have to pass through the points?

No, it is a summary of the overall trend, and most points will sit above or below it.

How do I know if the line is a good fit?

Check how tightly the points cluster around it, using a measure such as R-squared, where a value closer to 1 means a tighter fit.

Can I draw one in a spreadsheet?

Yes, most spreadsheet programs can add a trendline to a scatter chart and display its equation and R-squared.

Was this explanation helpful?

From the founder's library

Accounting Fundamentals: A Non-Finance Manager's Guide to Finance and Accounting, by Shihan Sheriff

Take it further with the book.

Build your financial confidence beyond this definition. Shihan's full-length guide, Accounting Fundamentals, takes the same plain-English approach and turns it into a complete, practical playbook for non-finance managers, business owners and students - with chapter-end quiz answers and presentation slides included.

US$2.24US$2.99

25% off with code MMHQ25, applied at checkout. Priced in USD - checkout may show the equivalent in your local currency.

View the book and save 25%
Last updated · October 8, 2026
Browse all terms →

Disclaimer

The information provided in this finance dictionary is for educational and informational purposes only. It should not be construed as financial, investment, legal, or tax advice. Always consult with a qualified professional before making any financial decisions. Money Master HQ makes no representations or warranties about the accuracy, completeness, or suitability of this information. Use of this content is at your own risk.