+ Reply to Thread
Results 1 to 5 of 5

Dynamically Change Table Name in a Structured Reference Using Index+Match??

  1. #1
    Registered User
    Join Date
    10-31-2017
    Location
    Salt Lake City
    MS-Off Ver
    2013
    Posts
    5

    Dynamically Change Table Name in a Structured Reference Using Index+Match??

    How can I write a Formula to change the Table Name in a Structured Reference? EXAMPLE: =COUNTIFS (BegBal[Referral], "*"&"Yes") Want to update the Table Name "BegBal" to "JanBal" as I drag the formula from right to left based on a Date Value in another cell. Need to nest the Formula in the COUNTIFS formula.

    Have learned how to do it using INDIRECT: =COUNTIFS(INDIRECT(F$11&"[Referral]"), "*"&"Yes"). But then the [Table Header] is not Dynamic and Excel does not auto-populate. The header names my change. I'd prefer to use Index+Match or some variant.

    Attachment included.
    Attached Files Attached Files
    Last edited by exceldemon; 09-24-2021 at 05:44 PM. Reason: Added attachment

  2. #2
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,822

    Re: Dynamically Change Table Name in a Structured Reference Using Index+Match??

    You would probably get more people to help you if you attached a sample file (please read the yellow banner at the top of the page).
    Based on what you're saying you want to do, I'm not sure you'll be able to get away from using Indirect, but let's see.

  3. #3
    Registered User
    Join Date
    10-31-2017
    Location
    Salt Lake City
    MS-Off Ver
    2013
    Posts
    5

    Re: Dynamically Change Table Name in a Structured Reference Using Index+Match??

    Attachment's added!

  4. #4
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,822

    Re: Dynamically Change Table Name in a Structured Reference Using Index+Match??

    I'm not sure I understand. I want to make sure I know why you don't like the formula you have. Is it because the table header of "Referral" might change to something else? Will it always be in the second column? Can you reference the table header with Indirect? I'm also not sure what you mean by "Excel does not auto-populate".

    If you can reference the column instead of the table header, and you want to reference the sheet name from the date (instead of the table name), you could try this in cell D7:
    =COUNTIFS(INDIRECT("'"&TEXT(D$4,"mm.dd.yy")&"'!$B:$B"),"Yes",INDIRECT("'"&TEXT(D$4,"mm.dd.yy")&"'!$A:$A"), $A7)
    (Your sheet names need to be consistent though for this. Your example sheet are different format - one has a 2 digit year, and the other has a 4 digit year.)

    Lastly, in your file you state:
    *Problem with this Formula is that [Referral] and [Location] have to be typed instead of suggested by Excel and are not Dynamic
    How would they be "suggested" by Excel?

  5. #5
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Taiwan
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,378

    Re: Dynamically Change Table Name in a Structured Reference Using Index+Match??

    worksheet name : Mthly

    Cell D3 formula , Drag right

    HTML Code: 
    There are Two ways

    Attachment only do the first way

    Use date format as worksheet name, but it must be in standard mode, for example 12.31.2020 , 01.31.2021 and etc

    worksheet name : Mthly

    Cell D7 formula , Drag down and across

    HTML Code: 
    Another way is to change the worksheet name to this BegBal,JanBal,FebBal and etc

    worksheet name : Mthly

    Cell D7 formula , Drag down and across

    HTML Code: 
    Attached Files Attached Files

+ 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: 6
    Last Post: 04-10-2019, 09:19 AM
  2. Using vba to automatically put a sheet referencing formula in a cell
    By jennis7242 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2019, 08:13 PM
  3. Referencing text in a cell to change formula
    By Number7stunner in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-03-2018, 04:12 PM
  4. Replies: 1
    Last Post: 11-13-2013, 02:07 AM
  5. Macro to Change color of cell after cross referencing date with a given date.
    By liajet24 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-24-2013, 12:33 PM
  6. Replies: 1
    Last Post: 10-14-2012, 12:23 AM
  7. Change Cell Font Color if Cell Contains Formula Referencing Another Cell
    By wilcox.patrick in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-10-2012, 10:24 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