+ Reply to Thread
Results 1 to 15 of 15

Need a sum if across multiple sheets in an external workbook

  1. #1
    Registered User
    Join Date
    09-17-2020
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    8

    Need a sum if across multiple sheets in an external workbook

    Good Day all

    I am in need of some assistance. I am attempting a sumif across multiple sheets in an external workbook. Below is my example. It is returning an error #NAME?. Please can you show me where Im going wrong?

    In the external workbook I have created a named range called Sheets. The path below is the path of the workbook

    =SUMPRODUCT(SUMIF(INDIRECT(" 'X:\All Of Budget BI\All of Budget 2022\All of Library 2022\[Mothership Expense Library 2022.xlsm]" & Sheets & " 'X:\All Of Budget BI\All of Budget 2022\All of Library 2022\[Mothership Expense Library 2022.xlsm]!$F:$F"),Profile!$G$13&$E12,INDIRECT(" 'X:\All Of Budget BI\All of Budget 2022\All of Library 2022\[Mothership Expense Library 2022.xlsm]" & Sheets &" 'X:\All Of Budget BI\All of Budget 2022\All of Library 2022\[Mothership Expense Library 2022.xlsm]!$J:$J")))

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,784

    Re: Need a sum if across multiple sheets in an external workbook

    Welcome to the forum.

    What does 'Sheets' refer to? Is that a named range or cell, and if so, does that named range exist?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    09-17-2020
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Need a sum if across multiple sheets in an external workbook

    Thanks for jumping in. Sheets is a named range in the external workbook and yes it exists in that workbook

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,784

    Re: Need a sum if across multiple sheets in an external workbook

    I suspect that Excel is expecting to find it in the workbook that the link is in. Or maybe the workbook linked to isn't open?

    Can you provide a sample workbook?

  5. #5
    Registered User
    Join Date
    09-17-2020
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Need a sum if across multiple sheets in an external workbook

    just to clarify, a sample of the workbook the formula exists in or a sample of the external workbook its looking to? Also the external workbook is open. As a by question will the indirect function work if the external workbook is closed?
    Last edited by Hot_Fuzz; 04-09-2021 at 11:57 AM.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,784

    Re: Need a sum if across multiple sheets in an external workbook

    If I remember correctly, no.

    Ideally a sample of each of the workbooks, however the one with the formula first so we can properly scrutinise the formula.

  7. #7
    Registered User
    Join Date
    09-17-2020
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Need a sum if across multiple sheets in an external workbook

    I have uploaded the two workbooks. the workbook one is where the formula exists and the Library is where it is looking to for the answer,. The name ranged exists in the Library spreadsheet
    Attached Files Attached Files
    Last edited by Hot_Fuzz; 04-12-2021 at 09:03 AM.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,784

    Re: Need a sum if across multiple sheets in an external workbook

    The named range refers to a workbook I don't have:

    ='X:\All Of Budget BI\All of Budget 2022\All of Shareblocks 2022\All of Baywater Village\[Baywater Village Shareblock Budget 2022.xlsm]1'!$AY$6:$AY$65

  9. #9
    Registered User
    Join Date
    09-17-2020
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Need a sum if across multiple sheets in an external workbook

    Sorry, \i left my old name range in the workbook. That has no range. The named range is in the library workbook (Unless im incorrect). I have attached the amended workbook without the named rage
    Attached Files Attached Files

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,784

    Re: Need a sum if across multiple sheets in an external workbook

    Sorry - I am going to have to ask you to explain - in WORDS - exactly what you are expecting the formula to do. Specifically, what is this meant to return?

    INDIRECT(" 'X:\All Of Budget BI\All of Budget 2022\All of Library 2022\[Mothership Expense Library 2022.xlsm]" & Sheets & " 'X:\All Of Budget BI\All of Budget 2022\All of Library 2022\[Mothership Expense Library 2022.xlsm]!$F:$F")

  11. #11
    Registered User
    Join Date
    09-17-2020
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Need a sum if across multiple sheets in an external workbook

    =SUMPRODUCT(SUMIF(INDIRECT(" 'X:\All Of Budget BI\All of Budget 2022\All of Library 2022\[Mothership Expense Library 2022.xlsm]" & Sheets & " 'X:\All Of Budget BI\All of Budget 2022\All of Library 2022\[Mothership Expense Library 2022.xlsm]!$F:$F"),A8&E11,INDIRECT(" 'X:\All Of Budget BI\All of Budget 2022\All of Library 2022\[Mothership Expense Library 2022.xlsm]" & Sheets &" 'X:\All Of Budget BI\All of Budget 2022\All of Library 2022\[Mothership Expense Library 2022.xlsm]!$J:$J")))

    My apologies for the back and forth.

    Right so in my words. I am working in the "workbook" spreadsheet on sheet 15. I have 60 sheets in the "Mothership Expense Library" workbook (I only added 5 sheets as an example). The named list (Named manager) is in the "Mothership Expense Library" workbook on the list sheet. The named range is called "sheets" I am trying to do a sumif across all 60 sheets (Named range "Sheets") - In Expense Library to calculate the total sum of the value in cell E11 of the workbook and return the sum it finds in cell G11 of the workbook in sheet 15. The Expense library workbook is an external book at the path "X:\All Of Budget BI\All of Budget 2022\All of Library 2022\[Mothership Expense Library 2022.xlsm]".

    I hope this helps. If not I will try give you a better response. I have uploaded the workbook spreadsheet again
    Attached Files Attached Files

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,784

    Re: Need a sum if across multiple sheets in an external workbook

    OK, well there's nothing in the library file on the two sample sheets to sum.

  13. #13
    Registered User
    Join Date
    09-17-2020
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Need a sum if across multiple sheets in an external workbook

    I have data and amounts in sheets 1, 2 and 5 in the library workbook. Column F has what it is summing and column J is the amount it is summing. I have attached the workbook again in case you have an older version
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    09-17-2020
    Location
    South Africa
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Need a sum if across multiple sheets in an external workbook

    Hi

    To simplify my need for assistance, I have reattached two workbooks, namely Data (Where im working) and Book1 (The external workbook).

    I need to sum the values of the name Peter in Book1 across all the sheets (1-5) and return the result in the Data workbook in cell B7. Below is my formula so far. Sheets is a named range I created in both workbooks.


    =SUMPRODUCT(SUMIFS(INDIRECT("'"&Sheets&"'!$B:$B"),INDIRECT("'"&Sheets&"'!$A:$A"),A7))

    What I am struggling with is 2 things:

    1. If book1 is located on my C drive, where would the link to this workbook be in the formula if the data workbook is not located in the same place. I'm struggling where to put it in the formula.
    2. Does the named range (For the sheets 1-5) need to be in the workbook im working, in this case Data workbook or in the external workbook, namely Book1?

    Thank you!
    Attached Files Attached Files

  15. #15
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: Need a sum if across multiple sheets in an external workbook

    I would recommend that the Answer sheet from the Data file be moved to Book1 to simplify the process.
    That said and as you are using the 365 version of Excel you could use Power Query (Get & Transform) to uncomplicate this to some degree.
    1. Convert all of the ranges on the 1:5 sheets in Book1 to tables.
    2. Utilize the following Advanced Editor code to produce a master table (modeled on the namedrange sheet):
    Please Login or Register  to view this content.
    3. The following formula may be placed in cell B7 on the Answer sheet in the Data workbook:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note that if the formula is activated (by pressing the Enter key) when both workbooks are open, then when Book1 is closed the formula should update automatically to include the entire path as stated in the tutorial linked below. If not you will need to type in the entire path to Book1.
    https://www.ablebits.com/office-addi...heet-workbook/
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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] Autofilter in Multiple sheets - copy sheets to new workbook - save workbook with a field
    By anchuri_chaitanya in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 03-21-2021, 01:30 AM
  2. Lookup accross multiple sheets in external workbook
    By Eustace07 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-03-2014, 08:47 AM
  3. Vlookup in external workbook over multiple sheets
    By rodgersmg in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-11-2014, 05:20 AM
  4. [SOLVED] Macro to copy cells from multiple sheets in workbook to multiple sheets in other workbook
    By KeithMale in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-13-2013, 05:37 PM
  5. Replies: 1
    Last Post: 06-21-2012, 03:55 PM
  6. select external workbook and them merge all sheets in one
    By jmaocubo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-22-2009, 09:49 AM
  7. VBA Access Common Cell in Many Different Sheets in an External Workbook
    By Software Bud in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-21-2008, 08:14 PM

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