Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default How to fit a "ln" function

I am in the process of fitting various data sets to functions. Some of these
data sets fit nicely using the LOGEST function in Excel, but several of the
data sets include negative and "zero" values -- LOGEST does not work with
such inputs. In charting the data sets with negative and zero values, I can
add a logarithmic trendline and get a function that includes the natural
logarithm (ln) that appears in the chart itself. Is there a function
accessible through Excel/VBA that will fit such a curve (similar to LOGEST)?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default How to fit a "ln" function

ln(0) is -infinity and ln(-x) is a complex number (involving
i=sqrt(-1)). What do you propose that Excel should do with these?

Comparing LOGEST to the logarithmic trendline is comparing apples to
oranges. LOGEST takes logs of the yData while the logarithmic trendline
takes logs of the xData.

If you want the equation of the logarithmic trendline, you can request
it from the Options tab of the Add Trendline dialog; alternately you can
use LINEST as in
=LINEST(yData,LN(xData))
array entered (Ctrl-Shft-Enter).

Jerry

Scott P wrote:

I am in the process of fitting various data sets to functions. Some of these
data sets fit nicely using the LOGEST function in Excel, but several of the
data sets include negative and "zero" values -- LOGEST does not work with
such inputs. In charting the data sets with negative and zero values, I can
add a logarithmic trendline and get a function that includes the natural
logarithm (ln) that appears in the chart itself. Is there a function
accessible through Excel/VBA that will fit such a curve (similar to LOGEST)?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default How to fit a "ln" function

Thanks, Jerry. I actually just figured out the use of LINEST as mentioned
below using LN(xdata). Just to clarify, in terms of your points below:

1. All of my x-values are = 0. I can deal with the case of ln(0)
individually and use the curve fit equation generated by
=LINEST(yData,LN(xData)) for the remainder of my x-values. Ln(-x) does not
apply (it is just my y values that contain negative numbers).

2. I was not comparing LOGEST to a logarithmic trendline. I was asking if
a function in Excel/VBA fit a curve in a logarithmic fashion and worked in a
way (e.g. takes inputs and provides parameters of the fitted curve) similar
to that of LOGEST.

Thanks.

"Jerry W. Lewis" wrote:

ln(0) is -infinity and ln(-x) is a complex number (involving
i=sqrt(-1)). What do you propose that Excel should do with these?

Comparing LOGEST to the logarithmic trendline is comparing apples to
oranges. LOGEST takes logs of the yData while the logarithmic trendline
takes logs of the xData.

If you want the equation of the logarithmic trendline, you can request
it from the Options tab of the Add Trendline dialog; alternately you can
use LINEST as in
=LINEST(yData,LN(xData))
array entered (Ctrl-Shft-Enter).

Jerry

Scott P wrote:

I am in the process of fitting various data sets to functions. Some of these
data sets fit nicely using the LOGEST function in Excel, but several of the
data sets include negative and "zero" values -- LOGEST does not work with
such inputs. In charting the data sets with negative and zero values, I can
add a logarithmic trendline and get a function that includes the natural
logarithm (ln) that appears in the chart itself. Is there a function
accessible through Excel/VBA that will fit such a curve (similar to LOGEST)?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text "comparison" operator for "contains" used in an "IF" Function Pawaso Excel Worksheet Functions 4 April 4th 23 11:35 AM
Excel 2003: Conditional Formatting using "MIN" & "MAX" function MMangen Excel Discussion (Misc queries) 2 September 16th 08 07:13 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
function to return day in the form "Monday", "Tuesday" etc given . MTro Excel Worksheet Functions 2 October 3rd 07 09:49 AM
inserting a conditional "go to" command on a excel "if" function velasques Excel Worksheet Functions 5 March 10th 06 08:16 PM


All times are GMT +1. The time now is 04:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"