+ Reply to Thread
Results 1 to 3 of 3

Problem with Array formula

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    839

    Problem with Array formula

    Hi,

    In Sheet1 I have a column of dates in B and values in columns F and G.

    I would like to use the formula below to calculate the r-squared (using Excel's RSQ function) of the data in columns F and G between the date range starting and ending on the dates in cells L1 and L2 of Sheet2.

    {=(rsq(IF('Sheet1'!$B$5:$B$500>'Sheet2'!L$1,IF('Sheet1'!$B$5:$B$500<='Sheet2'!L$2,'Sheet1'!F5:F500,'Sheet1'!G5:G500))))}

    However, I get an error message, saying the I've used too few arguments. What am I doing wrong?

    Thanks!

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Problem with Array formula

    Since the RSQ function is looking for 2 ranges...
    You may need to use this approach
    (untested....we don't have your data):
    =RSQ(IF((Sheet1!$B$5:$B$500>Sheet2!L$1)*(Sheet1!$B$5:$B$500<=Sheet2!L$2),
    Sheet1!F5:F500),IF((Sheet1!$B$5:$B$500>Sheet2!L$1)*
    (Sheet1!$B$5:$B$500<=Sheet2!L$2),Sheet1!G5:G500))
    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    839
    Brilliant, it works perfectly!

    Thanks very much Ron!!!

+ 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