PROJECT 90%....HansV wrote:That is because the known x-es and the new x are not 1, 2, 3, and 4, but 1 May 2014, 1 June 2014, 1 July 2014, and 1 August 2014. This version produces the same result as the formula:
Code: Select all
Sub TEST_TREND() Dim knowny As Range Dim knownx As Range Dim newx As Range Dim myval As Double Dim WS As Worksheet Set WS = Sheets("FOGLIO1") With WS Set knowny = .Range("D2:F2") Set knownx = .Range("D1:F1") Set newx = Range("G1") myval = Application.WorksheetFunction.Trend(knowny, knownx, newx) End With Debug.Print Format(myval(1), "#,##0.00") End Sub
now i need to rappresent the graph to consider the August month as a red trend line...?
how to?
last result in attached file.