What is the equation used to calculate a linear trendline?
I've been looking for this formula in this website so I've made it Q&A style :) Hope this helps.
Slope;
$$\alpha = {n\sum(xy) - \sum x \sum y \over n\sum x^2 - (\sum x)^2}$$
Offset:
$$\beta = {\sum y - \alpha \sum x \over n}$$
Trendline formula:
$$y = \alpha x + \beta $$
source : https://classroom.synonym.com/calculate-trendline-2709.html