// Code examples from: Linear Regression in Excel with LINEST, SLOPE and FORECAST — No Add-ins // https://www.atulvij.com/excel-linest-linear-regression // Review and adapt before running; examples use sample values. // ---- Example 1 (excel) ---- =SLOPE(C2:C25, B2:B25) ' extra sales for each extra ₹1 of ads =INTERCEPT(C2:C25, B2:B25) ' predicted sales with zero ad spend =RSQ(C2:C25, B2:B25) ' 0-1: how much of the variation the line explains =FORECAST.LINEAR(50000, C2:C25, B2:B25) ' predicted sales at ₹50,000 spend // ---- Example 2 (excel) ---- =LINEST(C2:C25, B2:B25, TRUE, TRUE)