+ Reply to Thread
Results 1 to 10 of 10

Updating formulae that reference data in another workbook when the data workbook is closed

  1. #1
    Registered User
    Join Date
    01-29-2016
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    27

    Updating formulae that reference data in another workbook when the data workbook is closed

    Hi. I have one main data spreadsheet with 65K+ lines of data of payments from clients. On another sheet in that workbook I have a report which shows, by way of formulae, total income data for top 50 clients by year, and then some other stuff, for one consultant.

    I have duplicated that report sheet in another workbook so that the consultant can work with it, and she can input some additional data (e.g. last meeting with client date), but not have any chance of messing up the original data! Both workbooks are on a shared drive so the path to the data workbook is identical on my machine and on hers.

    I update the data workbook once a month with exported data from our payment system. What I want is that the report workbook will update from the data workbook even when the data workbook is closed. My understanding is that this is possible.

    The formulae I have used are (I think) properly formatted, but when I click F9 to refresh the report workbook, all the formulae immediately show #VALUE! and there is a pop-up which says "A value used in the formula is of the wrong data type." However when I have the data workbook open, the report workbook updates properly.

    An example of the formulae I am using is as follows (they are quite complex, take a bit of time to calculate, but do work):
    =SUMPRODUCT(SUMIFS('C:\Data\Mastercopy of all data\[Combined data.xlsx]data'!$J:$J,'C:\Data\Mastercopy of all data\[Combined data.xlsx]data'!$E:$E,$C13:$L13))

    (This formula is essentially adding up the income column when the client name column is a specific value, as defined in 10 hidden columns in the report workbook).

    Am I doing something wrong?

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Updating formulae that reference data in another workbook when the data workbook is cl

    The SUMIFS function won't work on a closed file.

    First thing to know...

    Do not use entire columns as range references in the SUMPRODUCT function. Use smaller specific ranges.

    =SUMPRODUCT('C:\Data\Mastercopy of all data\[Combined data.xlsx]data'!$J1:$J100,--ISNUMBER(MATCH('C:\Data\Mastercopy of all data\[Combined data.xlsx]data'!$E1:$E100,$C13:$L13,0)))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    01-29-2016
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    27

    Re: Updating formulae that reference data in another workbook when the data workbook is cl

    Thanks Tony. The data is 65,000 line (data since 2008), and that's added to each month (not sure by how many) - is it worth restricting it to for e.g. J1:J100,000 (future-proofing for some years at least)- will that make a difference? If does take a very long time to calculate each time.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Updating formulae that reference data in another workbook when the data workbook is cl

    Yeah, you can do that. It's still better than using the entire columns as references!

  5. #5
    Registered User
    Join Date
    01-29-2016
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    27

    Re: Updating formulae that reference data in another workbook when the data workbook is cl

    Thanks, Tony. I have to re-gig it all soon, so will include this amendment then. I guess, as Excel has up to 1,048,576 rows, by using E:E I am asking it to check 1,048,576 rows. Using E1:E100000 that might effectively reduce the workload by a factor of about 10?
    I may be overcomplicating this, but is there a way to express it as E1:Ex , where x is the number of rows populated?

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Updating formulae that reference data in another workbook when the data workbook is cl

    Quote Originally Posted by Gareth1000 View Post
    Using E1:E100000 that might effectively reduce the workload by a factor of about 10?
    Yes

    I may be overcomplicating this, but is there a way to express it as E1:Ex , where x is the number of rows populated?
    I am not aware of a method to do that to link to a closed file.

  7. #7
    Registered User
    Join Date
    01-29-2016
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    27

    Re: Updating formulae that reference data in another workbook when the data workbook is cl

    I am not aware of a method to do that to link to a closed file.[/QUOTE]

    I'va abandoned the idea of having the report in a different workbook as it won't work when the data book is closed with the formulae I am using, so the report will just be on another sheet in the same book - is there therefore a way to make E1:Ex , where x is the number of rows populated work?

    (Thanks so much for all this help!)

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Updating formulae that reference data in another workbook when the data workbook is cl

    If the data will now be in the same file you can go back to using your original formula (less the path info):

    =SUMPRODUCT(SUMIFS(data!$J:$J,data!$E:$E,$C13:$L13))

  9. #9
    Registered User
    Join Date
    01-29-2016
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    27

    Re: Updating formulae that reference data in another workbook when the data workbook is cl

    Yes, I understand that, but is there a way of expressing 'all of column E, but only where there is data', without using 'E:E' (which will create a lof of work), or 'E:E100000' (to account for the fact that there are currently 65,000 lines, but it is being added to every month and will eventually exceed 100,000 lines, at which point the formulae will not work)? Does my question make sense?

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Updating formulae that reference data in another workbook when the data workbook is cl

    The SUMIFS function is a "smart" function.

    It will only evaluate the used range.

    If you have data down to row 50000 both of these formulas are equally efficient:

    =SUMPRODUCT(SUMIFS(data!$J:$J,data!$E:$E,$C13:$L13))

    =SUMPRODUCT(SUMIFS(data!$J$1:$J$50000,data!$E$1:$E$50000,$C13:$L13))

    You can still use dynamic ranges if desired. See this for more info on how to do that:

    http://www.contextures.com/xlNames01.html#Dynamic

+ 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. Reference data in a closed workbook!!!!
    By marvinabou7890 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-15-2016, 05:22 PM
  2. Updating Excel Table from Data of closed workbook
    By smartbuyer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-19-2015, 08:03 PM
  3. Matching data from closed workbook with open workbook based on cell values
    By kbkrueger in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-14-2015, 07:42 PM
  4. Replies: 0
    Last Post: 03-27-2014, 12:38 PM
  5. [SOLVED] Code to copy data from a closed workbook and paste in active workbook using named range.
    By paullie1912 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-28-2014, 02:38 AM
  6. [SOLVED] Trouble copying data from closed workbook into active workbook, referencing help
    By lepperga in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-20-2013, 01:48 PM
  7. [SOLVED] Copying data from a closed workbook into an open workbook ignoring excel filter?
    By reach78 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 09-17-2013, 12:31 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