+ Reply to Thread
Results 1 to 7 of 7

Filter Function with Dynamically Changing Data Column Based on Value in Another Field

  1. #1
    Registered User
    Join Date
    12-02-2023
    Location
    Minneapolis, MN USA
    MS-Off Ver
    Microsoft 365 (Mac)
    Posts
    2

    Filter Function with Dynamically Changing Data Column Based on Value in Another Field

    I have an Excel Worksheet to manage participants in a conference. It contains a data table (Table1) listing all the participants, some biographical data, and what events they plan to attend. I want to filter by nationality and event to show the data for people from a given nationality and attending any one event.

    I have managed to use the FILTER formula to spill the data in the sheet "Access Lists" for people from a given nationality. However, I am having trouble adding an additional element - the event. I want to dynamically change a field value and have that field value change the data column called in the FILTER formula, for example Table1(D5)=D5. As I understand, I should use the INDIRECT function to turn the dynamic field into text that be used by the FILTER formula.

    I have been playing with an INDIRECT function nested within a FILTER function to dynamically set the column that is returned. My formula below doesn't seem to work. Can someone show me where I went wrong? See sample file attached.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by diplomatt13; 12-03-2023 at 03:20 AM.

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

    Re: Filter Function with Dynamically Changing Data Column Based on Value in Another Field

    Welcome to the forum.

    That formula and the worksheet Participants are not in the sample file.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    12-02-2023
    Location
    Minneapolis, MN USA
    MS-Off Ver
    Microsoft 365 (Mac)
    Posts
    2

    Re: Filter Function with Dynamically Changing Data Column Based on Value in Another Field

    Sorry - my mistake. That was the original formula from my real file - forgot to change it as I created a sample file with dummy data for sharing purposes. I have changed it now.
    I would appreciate it if you would take another look at it.

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

    Re: Filter Function with Dynamically Changing Data Column Based on Value in Another Field

    Here you go (using your original attachment):

    Please Login or Register  to view this content.
    I hope your Mac version has HSTACK.

  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: Filter Function with Dynamically Changing Data Column Based on Value in Another Field

    Make the Data Validation match the headers in the table for events (with or without the space, but mae them match... for consistency).

    Then use (same result as in Post 4):

    =LET(A,Table1,B,MATCH(H4,Data!1:1,0),IFERROR(CHOOSECOLS(FILTER(A,(INDEX(A,,2)=H3)*(INDEX(A,,B)=1)),1,2,3,B),"None"))
    Attached Files Attached Files
    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
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,262

    Re: Filter Function with Dynamically Changing Data Column Based on Value in Another Field

    Anticipating the next question, here's a version that allows for all countries and any event. I've adapted the table headers and the validation list references.

    Please Login or Register  to view this content.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,262

    Re: Filter Function with Dynamically Changing Data Column Based on Value in Another Field

    Do you have any questions?

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

+ 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. Dynamically change x & y axis mins and maxs based on dynamically changing data?
    By udf463 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2021, 03:19 PM
  2. [SOLVED] Using Len function in pivot table as calculated field to filter data
    By jaryszek in forum Excel General
    Replies: 4
    Last Post: 02-02-2021, 04:19 AM
  3. Excel function to dynamically filter data?
    By BrendenSmith in forum Excel General
    Replies: 2
    Last Post: 03-08-2020, 10:49 PM
  4. Replies: 3
    Last Post: 11-06-2019, 10:45 AM
  5. [SOLVED] Data Manipulation: How to dynamically filter and sort a multi-column data set
    By deturnbull in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 04-12-2013, 05:35 AM
  6. Arrange/filter excel data according for 1 column field
    By ASP__DEVELOPER in forum Excel General
    Replies: 6
    Last Post: 08-17-2010, 12:47 AM
  7. Dynamically set the value for Field in auto filter
    By Brian C in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2006, 06:41 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