+ Reply to Thread
Results 1 to 9 of 9

Sumproduct refers to named ranges in closed workbook

  1. #1
    Forum Contributor Bob@Sun's Avatar
    Join Date
    09-03-2009
    Location
    Montuak, Usa
    MS-Off Ver
    Excel 2007
    Posts
    438

    Sumproduct refers to named ranges in closed workbook

    Hello,

    I am trying to do some calculations using as a source another(closed) workbook. I am using SUMPRODUCT and if I specify the range everything is fine, but if I refer to a named range then I am getting an error when the source file is closed. Is there a workaround for this problem?

    Thanks for the help!
    Attached Files Attached Files

  2. #2
    Forum Contributor Bob@Sun's Avatar
    Join Date
    09-03-2009
    Location
    Montuak, Usa
    MS-Off Ver
    Excel 2007
    Posts
    438

    Re: Sumproduct refers to named ranges in closed workbook

    Any ideas?

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Sumproduct refers to named ranges in closed workbook

    That won't work with dynamic named ranges.
    Remember what the dormouse said
    Feed your head

  4. #4
    Forum Contributor Bob@Sun's Avatar
    Join Date
    09-03-2009
    Location
    Montuak, Usa
    MS-Off Ver
    Excel 2007
    Posts
    438

    Re: Sumproduct refers to named ranges in closed workbook

    Any idea what I can do to make the calculation in a file different form the source file and to keep my dynamic named ranges???

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Sumproduct refers to named ranges in closed workbook

    Open the file. No alternatives, I'm afraid, unless you can use code in the source file to update a fixed named range each time it is saved.
    Last edited by romperstomper; 08-25-2010 at 08:40 AM. Reason: typo

  6. #6
    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: Sumproduct refers to named ranges in closed workbook

    I would have expected this to work:

    In workbook Calculation, with workbook Source open, define

    tbl Refers to =INDEX([Source.xls]Sheet1!$A:$A, 1):INDEX([Source.xls]Sheet1!$C:$C, MATCH("zzz", [Source.xls]Sheet1!$A:$A))

    tblName refers to =INDEX(tbl, 0, 1)

    tblMonth refers to =INDEX(tbl, 0, 2)

    tblItems refers to =INDEX(tbl, 0, 3)

    ... and the formula to

    =SUMPRODUCT((tblName=$A$2) * (tblMonth=B2), tblItems)

    ... and it does work, but only as long as Source is open.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Sumproduct refers to named ranges in closed workbook

    I think the problem is with the range:index(range) syntax. Neither that, nor OFFSET, seem to be happy with closed workbooks.
    More strangely, testing with:
    ='C:\[Source.xls]Sheet1'!$A$1:INDEX('C:\[Source.xls]Sheet1'!$A$1:$A$10,2)
    works, but if you change the 2 to 3, a #REF! error is returned. :shrug:

  8. #8
    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: Sumproduct refers to named ranges in closed workbook

    That it fails with OFFSET I get.

    Is it because because INDEX is interpreted as the Reference form, which returns a range reference, which invalidates its usage?

    I can't reconcile that with your example that works, though.

  9. #9
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Sumproduct refers to named ranges in closed workbook

    That was my thought. I suspect the working example is the aberration.

+ 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