cwunderlich
Board Regular
- Joined
- Sep 24, 2010
- Messages
- 101
I have two ranges of data in excel (years are the "known x's" and data points are the "known y's"). I am trying to find the exponential trend using an excel formula.
Assume years are in range B2:B13 and data points are in range C2:C13.
I believe I found the following formula to work: =LINEST(LN(C2:C13),B2:B13)***
The problem is that I need to figure out how to do this analagous calculation in VBA. VBA already has each data range stored to a separate array. I tried the following syntax but I keep getting a "Type mismatch" error:
Trend = Application.WorksheetFunction.LinEst(Log(DataSet), Yrs) <- where Trend, DataSet, and Yrs are all declared as Double
can someone please help me with this.
***Also, part of my issue involves the following question: within excel, how does the LN(C2:C13) piece work exactly? I thought LN() argument could only take one data point as input.
Thank you.
Assume years are in range B2:B13 and data points are in range C2:C13.
I believe I found the following formula to work: =LINEST(LN(C2:C13),B2:B13)***
The problem is that I need to figure out how to do this analagous calculation in VBA. VBA already has each data range stored to a separate array. I tried the following syntax but I keep getting a "Type mismatch" error:
Trend = Application.WorksheetFunction.LinEst(Log(DataSet), Yrs) <- where Trend, DataSet, and Yrs are all declared as Double
can someone please help me with this.
***Also, part of my issue involves the following question: within excel, how does the LN(C2:C13) piece work exactly? I thought LN() argument could only take one data point as input.
Thank you.