+ Reply to Thread
Results 1 to 8 of 8

Using IF-based array formula within INDEX(LINEST()) formula

Hybrid View

  1. #1
    Registered User
    Join Date
    12-21-2012
    Location
    Boston, MA, USA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Using IF-based array formula within INDEX(LINEST()) formula

    Hey folks,

    Trying to get this formula to work. I have it working on my sheet when I use SLOPE() and INTERCEPT(), but since I am calculating the equation for a 3rd order polynomial, those won't do.

    Here is my formula:
    =INDEX(LINEST(IF('Backend Analysis'!$AC$3:$AC$367<200,'Backend Analysis'!$AC$3:$AC$367),IF('Backend Analysis'!$AC$3:$AC$367<200,'Backend Analysis'!$D$3:$D$367)^{1,2,3}),1)

    The problem is that I am getting the same answer as if I enter it without the IF-based array filter, which is this equation:
    =INDEX(LINEST('Backend Analysis'!$AC$3:$AC$367,'Backend Analysis'!$D$3:$D$367^{1,2,3}),1)

    The spirit of the formula is to only use values from the AC array and the D array where the value in that same row of the AC array is < 200 (200 is a stand in, this will ultimately be a dynamic formula, but if I can get it working with a hardcoded number, it's easy enough to do the rest)

    I suspect it has something to do with the fact that linest, itself, is an array formula -- just not sure though. Any help would be much appreciated!!

    T
    Last edited by thalsted; 09-22-2015 at 01:05 PM.

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

    Re: Using IF-based array formula within INDEX(LINEST()) formula

    Once you solve whatever the immediate problem is, that will pass interleaved values of False and numbers to LINEST, which it will not be happy with. Some function ignore non-number values; LINEST throws up.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    12-21-2012
    Location
    Boston, MA, USA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Using IF-based array formula within INDEX(LINEST()) formula

    Great point shg! The data for this application is actually super clean -- free of blanks/errors. Thanks for the words of caution though, it is a finicky function, for sure.

    T

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

    Re: Using IF-based array formula within INDEX(LINEST()) formula

    I don't think you're getting it.

    If the source data didn't contain values >= 200, there would be no need for the IF function. If it does, then the input to LINEST will be numbers interleaved with False, which won't work.

  5. #5
    Registered User
    Join Date
    12-21-2012
    Location
    Boston, MA, USA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Using IF-based array formula within INDEX(LINEST()) formula

    Got it -- makes sense now. If I were to put 200 in the false argument, perhaps that would fix the issues (essentially putting an upper limit in place) -- will try and report back!

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

    Re: Using IF-based array formula within INDEX(LINEST()) formula

    Also not sure why you are using INDEX() to return just the first value.

  7. #7
    Registered User
    Join Date
    12-21-2012
    Location
    Boston, MA, USA
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Using IF-based array formula within INDEX(LINEST()) formula

    Mission accomplished -- I filled in the FALSE argument with a different value and now the function works.

    On using INDEX -- I am just using the formulas from this site and they seem to get the job done...
    http://spreadsheetpage.com/index.php...line_formulas/

    Thanks for your help shg!

    T

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

    Re: Using IF-based array formula within INDEX(LINEST()) formula

    Using the INDEX function like that is intended (I hope), for information (as in "Yup, that's the way they come out"), not direction (as in "Here's how you should do it").

    LINEST returns all of the coefficients in a single array formula. Extracting them one by one using INDEX means you repeat the entire regression -- which is non-trivial -- for every coefficient.
    Last edited by shg; 09-25-2015 at 03:43 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Index & Array Formula
    By Tim204030 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-24-2015, 11:47 AM
  2. [SOLVED] Help with Array and index Formula
    By shayej in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-26-2015, 06:22 PM
  3. Sum with array formula in index
    By Matthys.Steyn in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-17-2013, 10:44 AM
  4. Replies: 2
    Last Post: 06-20-2012, 12:22 PM
  5. LINEST array formula not working
    By mouseclicker in forum Excel General
    Replies: 2
    Last Post: 10-12-2010, 08:29 PM
  6. Index array formula?
    By kdestef1 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 04-11-2009, 10:56 AM
  7. SUM of INDEX as array formula
    By CJEJung in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-21-2008, 01:15 PM

Tags for this Thread

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