+ Reply to Thread
Results 1 to 7 of 7

Reference tab/sheet name in formula

  1. #1
    Registered User
    Join Date
    05-26-2022
    Location
    USA
    MS-Off Ver
    365
    Posts
    35

    Reference tab/sheet name in formula

    I would like to reference a sheet name in a formula that will change based on the sheets name.

    For example each sheet will be labeled by date but will then need to index a sheet by the same name with "Export" added

    Below is the formula i have so far. I want to be able to use this formula without needing to change the export sheet reference each time i make a new one.

    =IF(ISBLANK(INDEX('3-13-23 Export'!$B$3:$AR$83,MATCH(XLOOKUP($J25,Roster!$B:$B,Roster!$A:$A,,,),'3-13-23 Export'!$A$3:$A$83,0),MATCH(L$19,'3-13-23 Export'!$B$2:$AR$2,0))),"",INDEX('3-13-23 Export'!$B$3:$AR$83,MATCH(XLOOKUP($J25,Roster!$B:$B,Roster!$A:$A,,,),'3-13-23 Export'!$A$3:$A$83,0),MATCH(L$19,'3-13-23 Export'!$B$2:$AR$2,0)))

    I have underlined the reference i need to treat this way

  2. #2
    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,443

    Re: Reference tab/sheet name in formula

    Without a sample sheet, it's hard to be exact... but there seems to be a lot of redundancy in your formula. Depending on the data the ISBLANK bit seems unnecessary.


    =INDEX(INDIRECT("'"&A2&" Export'!B3:AR83"),MATCH(XLOOKUP($J25,Roster!$B:$B,Roster!$A:$A,,,),INDIRECT("'"&A2&" Export'!a3:A83"),0),MATCH(L$19,INDIRECT("'"&A2&" Export'!B2:AR2"),0))

    should get you going. Please post a sample sheet so we can complete the job. A2 contains the date of the sheet to be references..e.g. 3-13-23
    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

  3. #3
    Registered User
    Join Date
    05-26-2022
    Location
    USA
    MS-Off Ver
    365
    Posts
    35

    Re: Reference tab/sheet name in formula

    I have attached a sample. For reference. Please let me know if I'm over doing it.
    Attached Files Attached Files

  4. #4
    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,443

    Re: Reference tab/sheet name in formula

    1. There is no need to do the calculation twice. the addition of &"" will return nulls appropriately.

    2. All those INDIRECTS will slow your sheet down, as they recalculate everything each time anything changes.

    3. You don't need them anyway. Since you are only referring to ONE sheet, it's better (by far) just to hard code the name into the formula.

    In , copied across and down:

    =INDEX('2-13-23 Export'!$B$3:$AS$200,MATCH(XLOOKUP($J25,Roster!$B:$B,Roster!$A:$A,,,),'2-13-23 Export'!$A$3:$A$200,0),MATCH(L$19,'2-13-23 Export'!$B$2:$AR$2,0))&""
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-26-2022
    Location
    USA
    MS-Off Ver
    365
    Posts
    35

    Re: Reference tab/sheet name in formula

    Thank you! Does the &"" take the place of the isblank statement

  6. #6
    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,443

    Re: Reference tab/sheet name in formula

    Yes. 0&"" returns a null.

  7. #7
    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,443

    Re: Reference tab/sheet name in formula

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please click on "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

+ 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. Copy Formula To New Sheet Keeping Reference to First Sheet
    By WickedxJosh in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-11-2018, 10:32 AM
  2. Sheet Reference Problem, Formula suddenly referencing wrong sheet
    By Matt97NeedsHelp in forum Excel General
    Replies: 2
    Last Post: 07-11-2017, 10:16 AM
  3. [SOLVED] Locked formula changes reference when rows added to reference sheet in same workbook
    By macrorookie in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-19-2014, 04:08 PM
  4. Add Sheet reference to formula
    By mattress58 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-14-2014, 03:43 PM
  5. VBA formula to reference Sheet Name
    By jhall488 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-18-2013, 01:31 PM
  6. [SOLVED] Use cell reference on one sheet as a sheet name in a formula on another sheet
    By GavJ in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-10-2013, 05:06 AM
  7. Dragging formula, change sheet reference, but not cell reference
    By Kalilaya0419 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-13-2013, 04:50 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