# Need IF statement (inside of Linest Function) that will select range based on dates

1. ## Need IF statement (inside of Linest Function) that will select range based on dates

Hello All,

This may sound a bit confusing, but I really need some help processing a large volume of data. OK so I need to use LINEST to extract Gamma, Beta, and Alpha from a list of data based on a quadratic equation. However, I want to be able to add an if function/statement so that the range of the LINEST function is only for data pertaining to a certain year. I have attached the worksheet. the LINEST functions for Gamma, Beta, and Alpha are in cells A2,B2, and C2 respectively (they are currently only using 2008, for example).

Basically I need to figure out a way to select the range for the three linest functions based on the year in (column A values) was collected. I need a dynamic range because different years, and subsequent data sites, have different # of observations. If anyone could help me solve this problem it would be greatly appreciated! Let me know if this is confusing, it is difficult to put into words.
Excel_Question_Example.xlsx

2. ## Re: Need IF statement (inside of Linest Function) that will select range based on dates

Put the year in E2.
Find the row of the first data point for that year:
F2:
``Please Login or Register  to view this content.``
Find the last data point row:
G2:
``Please Login or Register  to view this content.``

Gamma:
``Please Login or Register  to view this content.``
Beta:
``Please Login or Register  to view this content.``
Alpha:
``Please Login or Register  to view this content.``

3. ## Re: Need IF statement (inside of Linest Function) that will select range based on dates

Thank you so much! You just saved me a lot of time (and headache--ha!)

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