+ Reply to Thread
Results 1 to 5 of 5

Creating a UDF to show a trend to the minimum point in a range

  1. #1
    Registered User
    Join Date
    02-02-2010
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    3

    Creating a UDF to show a trend to the minimum point in a range

    I am trying to write a UDF to give a result based on the the =TREND() function in Excel 2003. This should take the defined range and given the fixed start point, should calculate the trend using the data to the minimum point only. Below is the code I have so far.

    Please Login or Register  to view this content.

    Using the data (see below) and a to date of 29/01/2010 with this code I get the answer 3061.506, however if I manually select the range to the minimum point and use the =TREND() formula, I get the result 3087.098.


    Please Login or Register  to view this content.

    Thanks in advance for any help.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Creating a UDF to show a trend to the minimum point in a range

    Welcome to the forum.

    How about posting a workbook that includes an instance of the function as well as the formula?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    02-02-2010
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Creating a UDF to show a trend to the minimum point in a range

    Here's the file
    Attached Files Attached Files

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Creating a UDF to show a trend to the minimum point in a range

    If you step through your code and look at indices, you'll see that you're not capturing the correct ranges.

    Try this:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-02-2010
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Creating a UDF to show a trend to the minimum point in a range

    Thanks for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1