+ Reply to Thread
Results 1 to 3 of 3

LINEST with criteria

  1. #1
    Registered User
    Join Date
    09-23-2015
    Location
    Las Vegas
    MS-Off Ver
    2010
    Posts
    2

    LINEST with criteria

    Hi,
    I'm trying to figuring out if it's possible to use linest with a conditional array. I've attached a similar spreadsheet with less data than the one I'm using. Basically, I'd like the known y's and x's to come only from a unique reference (ex. WIDGET). If column A has multiple values with "WIDGET" and column B has multiple corresponding y data, how can I change LINEST to reference just 1 unique value from column A (ex Widget) but sort's through all of that values y data?
    I have tried.

    =LINEST(IF($A$2:$A$7=E2,$B$2:$B$7,""),IF($A$2:$A$7=$E$2,$C$2:$C$7,""))

    Thanks in advance!
    LINEST example.xlsx

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: LINEST with criteria

    I have not found a similar way to do this. The LINEST() function just cannot operate with blanks, text, or boolean values anywhere in either the known_y or known_x arrays. One way or another, you need to extract the desired data into another array/range.

    The easiest approach might be a filter approach - advanced filter in particular. With the correct settings in the advanced filter, you can have Excel extract the desired subset of the data from the main database, then place that subset into another block of cells. LINEST() can then be entered referring to that block of cells. If you are unfamiliar with the advanced filter function, I would suggest a tutorial similar to this one: http://www.contextures.com/xladvfilter01.html
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: LINEST with criteria

    Instead of LINEST (it requires y and x ranges to be continous) use two separate array formulas*:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    of course for SPROCKET in sample data you will get an error, because you have only one x;y point

    *) ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    Attached Files Attached Files
    Best Regards,

    Kaper

+ 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. [SOLVED] Linest of rows matching criteria
    By RodGob in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-12-2013, 05:50 AM
  2. [SOLVED] Linest Function - Unable to get LinEst property of the WorksheetFunction class
    By fbs13 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-25-2013, 09:55 AM
  3. LINEST Help
    By mperata in forum Excel General
    Replies: 2
    Last Post: 05-10-2012, 11:20 PM
  4. LINEST or how
    By triag in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-18-2010, 01:11 PM
  5. Value of LINEST
    By aner1755 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-09-2009, 04:27 AM
  6. Linest
    By soulwind in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2007, 03:48 PM
  7. [SOLVED] LINEST()
    By Bove Farm in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-29-2006, 01:00 AM
  8. [SOLVED] Linest - Why did they do that?
    By cseeton in forum Excel General
    Replies: 2
    Last Post: 03-11-2005, 09:06 AM

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