+ Reply to Thread
Results 1 to 5 of 5

Using FILTER() to return a variable number of records

  1. #1
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,373

    Using FILTER() to return a variable number of records

    As I get used to this newer version of Excel, one of the tasks I frequently do is Filtering a batch of calculations. My spreadsheets look substantially like the attached. In the calculations tab, there will be identifiers, a few columns of inputs, several columns of intermediate calculations, and a few output columns with the final results. What I then need to do is choose a few columns (These don't change frequently, so I'm not worried about these being dynamic in the function), then filter based on id no. In my old version of Excel, I used lookups to bring all of the desired data over into "Table", then used Autofilter to filter on id no. I'm trying to figure out the same kind of thing using the newer FILTER() function.

    You can see my current attempt in the sample. It works great as long as I am looking for exactly two id no. in A6 and A7. If I want to add another id no, then I need to add a +(calculations!A4:A22=Table!A8) to the function.

    What I want to be able to do is enter the desired id nos in Table!A6:A10 (from just one id no to all five possible), and have those records show up in columns C:E.

    How do I structure the "criteria" argument to handle this?
    Attached Files Attached Files
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: Using FILTER() to return a variable number of records

    How about
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Or for both D & E
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,373

    Re: Using FILTER() to return a variable number of records

    Thank you Fluff13, that works.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: Using FILTER() to return a variable number of records

    You're welcome & thanks for the feedback.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,373

    Re: Using FILTER() to return a variable number of records

    The CHOOSECOLS() function inside there was a nice bonus. Now I can put the desired column numbers in C1:E1 (1,2,8), and use those as reference =FILTER(CHOOSECOLS(calculations!$B$4:$H$22,C1,D1,E1),ISNUMBER(XMATCH(calculations!$A$4:$A$22,FILTER(A6:A10,A6:A10<>"")))). Now when I want to see different columns in "Table", I can simply enter the desired columns in row 1.

+ 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. [SOLVED] Reformatting macro which needs to insert rows after a variable number of records.
    By PeterWB in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-13-2023, 05:00 AM
  2. Replies: 1
    Last Post: 05-08-2021, 11:09 PM
  3. Cap an invoice with a footer after a variable number of records
    By shevy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-31-2010, 07:53 PM
  4. filter function for a great number of records
    By amyowm in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-23-2010, 06:19 PM
  5. Auto Filter - Number of records
    By Walldorc in forum Excel General
    Replies: 2
    Last Post: 12-17-2008, 09:06 AM
  6. [SOLVED] Advanced Filter: Number of Records Found
    By Debra Dalgleish in forum Excel General
    Replies: 3
    Last Post: 11-03-2005, 05:15 PM
  7. Advanced Filter: Number of Records Found
    By Charlie Rowe in forum Excel General
    Replies: 0
    Last Post: 11-02-2005, 06:17 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