+ Reply to Thread
Results 1 to 5 of 5

Dynamically referencing sheet names into formula

  1. #1
    Registered User
    Join Date
    12-21-2021
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel
    Posts
    2

    Question Dynamically referencing sheet names into formula

    Hello!

    I am trying to dynamically link data from different sheets into one master sheet. To do this, I am using the XLOOKUP formula, then referencing the row (eg. price), eg. then sheet and array where the text 'Price' can be found, then the sheet and array that the price to be called out into my master sheet. Example: -

    "=XLOOKUP("Price",'Chair'!A:A,'Chair'!C:C,"-")

    I have all these set up for each different row of data I want to export (eg. price, colour, type) and it does work. The issue is, when I create a new row in my master document I have to manually change the sheet name in every column. Eg I am changing 'Chair' to 'Table' to reference the different sheet titles.

    It is a real pain, and I am struggling to come up with a way to automatically be able to reference to the sheet name that can dynamically be input (input once and it will change for that row of formulas).

    Does anyone have any advice?

    Thank you in advance.

    All the best,
    Beck

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: Dynamically referencing sheet names into formula

    see big yellow banner - how to upload your workbook.
    with the actual data layout it is far easier to give relative advice and alternatives.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,714

    Re: Dynamically referencing sheet names into formula

    You would normally use the INDIRECT function for that. If you had the sheetname in a cell (e.g. X1 for illustration), then you could do this:

    =XLOOKUP("Price",INDIRECT("'"&X1&"'!A:A"),INDIRECT("'"&X1&"'!C:C"),"-")

    Change the cell reference as required.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    12-21-2021
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel
    Posts
    2

    Re: Dynamically referencing sheet names into formula

    Pete_UK - Thanks so much! This had actually been what I was trying, but I realise now I had added an extra space to the end of my sheetname which was causing me a lot of #REF errors. I have it now! Thank you.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,714

    Re: Dynamically referencing sheet names into formula

    Glad to hear it.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 3 users browsing this thread. (0 members and 3 guests)

Similar Threads

  1. Index formula referencing a table dynamically
    By Lou Fuller in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-21-2021, 03:46 AM
  2. [SOLVED] Referencing Sheet names in formula
    By pickslides in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-11-2014, 11:13 PM
  3. [SOLVED] Dynamically referencing Tab names?
    By johanna0507 in forum Excel General
    Replies: 11
    Last Post: 11-05-2013, 11:22 AM
  4. Referencing a Named Range or Sheet dynamically
    By damidre in forum Excel General
    Replies: 3
    Last Post: 04-20-2013, 03:54 AM
  5. Referencing a Named Range or Sheet dynamically
    By damidre in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-20-2013, 02:42 AM
  6. [SOLVED] Referencing a Named Range or Sheet dynamically
    By damidre in forum Excel General
    Replies: 4
    Last Post: 04-19-2013, 02:13 PM
  7. Dynamically create a formula in Sheet B referencing SheetA
    By SHIPP in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-17-2005, 12:06 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