+ Reply to Thread
Results 1 to 11 of 11

Indirect referencing to a different worksheet&Table

Hybrid View

  1. #1
    Registered User
    Join Date
    04-11-2022
    Location
    calgary, Canada
    MS-Off Ver
    Office 365, Excel for Mac
    Posts
    15

    Indirect referencing to a different worksheet&Table

    Can someone help me write this indirect formula without cell referencing, I can't seem to wrap my head around what I'm doing wrong...

    In cells,

    B2(file name): 2010_Sold.xlsx
    B3(Table Name): January
    B4(Column Name): Current Price

    And this formula works: =SUM(INDIRECT("'"&B2&"'!"&B3&"["&B4&"]"))

    However, Id like to not reference cells in the formula. I've done this within a workbook but cant seem to get it to work when indirectly referencing a different workbook.

    So something like this(But I'm obviously not writing it correctly, as im getting a #REF! error):

    =SUM(INDIRECT("'"&{2010_Sold.xlsx}&"'!"&January&"["&Current Price&"]"))

    How do I write this?

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Indirect referencing to a different worksheet&Table

    You'd be better advised to upload the two workbooks so that we can can check this in context.
    Presumably you are aware that INDIRECT doesn't work unless the file referred to is Open?

    It's also confusing since you say the formula that works refers to B2! which I presume means a sheet called whatever is held in B2. But B2 is the name of a file.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    04-11-2022
    Location
    calgary, Canada
    MS-Off Ver
    Office 365, Excel for Mac
    Posts
    15

    Re: Indirect referencing to a different worksheet&Table

    My Apologies, One of the workbooks isn't shareable.

    I made a couple replica versions.

    See attached.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    04-11-2022
    Location
    calgary, Canada
    MS-Off Ver
    Office 365, Excel for Mac
    Posts
    15

    Re: Indirect referencing to a different worksheet&Table

    Quote Originally Posted by Richard Buttrey View Post
    You'd be better advised to upload the two workbooks so that we can can check this in context.
    Presumably you are aware that INDIRECT doesn't work unless the file referred to is Open?

    It's also confusing since you say the formula that works refers to B2! which I presume means a sheet called whatever is held in B2. But B2 is the name of a file.
    Im all sorts of confused.
    But when i enter = and select the whole column in the 2010_Sold workbook I get:

    ='2010_Sold.xlsx'!January[Current Price]

    It should be noted, that the sheet is called January and the Table is also called January.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Indirect referencing to a different worksheet&Table

    The syntax that you need is:

    =SUM('2010_Sold.xlsx'!January[Current Price])
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 04-15-2022 at 03:09 AM.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  6. #6
    Registered User
    Join Date
    04-11-2022
    Location
    calgary, Canada
    MS-Off Ver
    Office 365, Excel for Mac
    Posts
    15

    Re: Indirect referencing to a different worksheet&Table

    Quote Originally Posted by Glenn Kennedy View Post
    The syntax that you need is:

    =SUM('2010_Sold.xlsx'!January[Current Price])
    unfortunately, I need an indirect formula. As I will eventually be including other sheets for a total sumif(indirect())/countif(indirect()) formula. as I need the average of multiple table columns from different sheets.

  7. #7
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Indirect referencing to a different worksheet&Table

    I am not sure what the issue is with what you have... just replace the "" References to cells with the text in those cells...

    =SUM(INDIRECT("'2010_Sold.xlsx'!January[Current Price]"))
    -If you think you are done, Start over - ELeGault

  8. #8
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Indirect referencing to a different worksheet&Table

    You know... I think the problem isnt the indirect its that you are indirectly accessing a closed files... several solutions... but likely quickest way through this is to define the path so that it knows where the reference is... right now its hunting for a workbook that becomes invisible to excel upon close... But if you write in the path you can reference the closed book... I would have to play with it a bit to get it to do math against the closed book.... but if you preset a field within these reports that has the figure you need to call on.... K9=SUM(January[Current Price]) on the 2021_Sold January tab.... =INDEX('C:\Users\Your.Name\Downloads\[2010_Sold.xlsx]January'!K9,1,1) you will get the value to populate even when the sold book is closed

  9. #9
    Registered User
    Join Date
    04-11-2022
    Location
    calgary, Canada
    MS-Off Ver
    Office 365, Excel for Mac
    Posts
    15

    Re: Indirect referencing to a different worksheet&Table

    My issue, is that I need an average from different tables from different sheets. For example, I need to do a accurate quarterly average of the prices from january,february & march. the only way I can think to do this is to do a indirect formula to gather the data from the different tables. I'm not so concerned about it being open or closed. I can have them open or closed when needed. the workbook with all the data will remain unchanged. I have many workbooks with data spanning many years. so altering them would take up lots of time.

    Maybe im missing a simpler solution.

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Indirect referencing to a different worksheet&Table

    Quote Originally Posted by lelliott7 View Post

    Maybe im missing a simpler solution.
    Indeed, maybe you are.

    As I understand it you have data from different months spread across multiple workbooks. If so this really isn't the best approach.
    As far as is practical you should always gather data that is the same layout, like monthly tables of information in the same workbook and in the same sheet, where you have a column that contains a reference to the month if that is not already part of your data.

    How are you capturing your monthly data? Is it from some back office system? If so get that system to download all months rather than just one.
    Otherwise use a macro to build the single table by looping through all the files and copying and pasting the data.

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Indirect referencing to a different worksheet&Table

    You did NOT tell us that you wanted to reference different tables/different sheets until Post 6.

    1. Please confirm that you understand that INDIRECT ONLY works when source sheets and destination sheets are open.

    2. Upload a properly representative set of sample sheets.

+ 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. Replies: 2
    Last Post: 07-04-2016, 02:55 AM
  2. [SOLVED] Indirect function, referencing another worksheet
    By dowell89 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-24-2013, 05:38 AM
  3. [SOLVED] Referencing a vlookup table on another worksheet
    By Glenn Kennedy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-19-2013, 01:29 AM
  4. Referencing a named table on a different worksheet
    By robh0409 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2013, 06:11 AM
  5. Indirect referencing Worksheet with space in the name
    By HULK_SMASH in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-18-2013, 02:26 PM
  6. Indirect Worksheet Function Referencing Another Worksheet
    By Larry.LeBlanc@O in forum Excel General
    Replies: 1
    Last Post: 11-13-2009, 05:51 PM
  7. Referencing with Indirect
    By RBI in forum Excel General
    Replies: 5
    Last Post: 09-26-2008, 02:29 PM

Tags for this Thread

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