+ Reply to Thread
Results 1 to 20 of 20

Creating a custom filter based on a lookup table?

  1. #1
    Registered User
    Join Date
    03-15-2014
    Location
    Bedford, England
    MS-Off Ver
    Excel 2010
    Posts
    10

    Creating a custom filter based on a lookup table?

    Basically I have a sheet full of objectives. Each objective is given a code for example N2.1,N2.2.....N8.4. These objectives are linked to units. Unit 1 for example might contain objective N2.1, N3.4, N6.7 and so on. Some of the units contain the same objectives. I've created a table like this...

    Unit 1 Unit 2 Unit 3
    N2.1 N2.1 N3.4
    N3.2 N3.4 N4.5
    . . .
    . . .

    Now what I want to do is to be able to select a unit so it only shows the objectives in that unit. The best I've come up with is using a basic filter and selecting all of the objectives manually but want something better.

  2. #2
    Forum Contributor
    Join Date
    05-29-2009
    Location
    Kalgoorlie Australia
    MS-Off Ver
    Excel 2007/10
    Posts
    251

    Re: Creating a custom filter based on a lookup table?

    hello
    could you please attach a copy of what you have
    peter

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Creating a custom filter based on a lookup table?

    Hi, and welcome to the forum

    You'd be better advised to change your format to a simple table that can be used by a standard Autofilter (or if more data columns should become involved perhaps a Pivot Table). i.e.

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    03-15-2014
    Location
    Bedford, England
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Creating a custom filter based on a lookup table?

    Capture.jpg

    This is the main sheet I'm using. It will have data of pupils along the top and colour coded based on level of understanding. The codes for the objectives are down the side so I want to be able to set up the filter so I can only see objectives linked to a particular unit.

    Richard, I don't think your idea would work as that should require duplicates of each objective which is repeated in another topic?

  5. #5
    Registered User
    Join Date
    03-15-2014
    Location
    Bedford, England
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Creating a custom filter based on a lookup table?

    Any ideas?

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Creating a custom filter based on a lookup table?

    Quote Originally Posted by goldenglow90 View Post
    Attachment 304622

    This is the main sheet I'm using. It will have data of pupils along the top and colour coded based on level of understanding. The codes for the objectives are down the side so I want to be able to set up the filter so I can only see objectives linked to a particular unit.

    Richard, I don't think your idea would work as that should require duplicates of each objective which is repeated in another topic?
    Hi,

    Why do you think my table won't work? Your stated objective was
    to be able to select a unit so it only shows the objectives in that unit.
    My table does exactly that when you filter column A for the unit required. Your table contains duplicates so I'm not clear why you seem to be saying that's a problem. To do what you want to do it's essential.

    Not sure what you mean by 'topic' since this wasn't mentioned in the OP.

  7. #7
    Registered User
    Join Date
    03-15-2014
    Location
    Bedford, England
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Creating a custom filter based on a lookup table?

    Topic/Unit, same thing.

    Both the table in my first post and yours would work as some sort of lookup table but your haven't stated how this could be used to filter the spreadsheet in the picture of my next post. In the spreadsheet there are no duplicates. Ideally what I want to do is to be able to click on the box in the picture which says Number and have a drop down menu for Unit 1, Unit 2 ... and so on and if I click Unit 1 then only the objectives in Unit 1 are shown.

    I've attached some pictures to give an idea of what I want (these are only pictures, I haven't solved the problem).

    Picture1.jpg

    Picture2.jpg

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Creating a custom filter based on a lookup table?

    Please upload a copy of your workbook - see guidance and reasons why in the rules area. Pictures are rarely much use and most of us are disinclined to recreate your workbook when it's readily available.

    It would help if you could also create on a second sheet exactly what you want to see for a particular selection on the first sheet.

  9. #9
    Registered User
    Join Date
    03-15-2014
    Location
    Bedford, England
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Creating a custom filter based on a lookup table?

    Here is the workbook

    The second sheet is an example of what it should look like once a unit has been selected from a drop down menu

    Sample.xls

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Creating a custom filter based on a lookup table?

    Hi,

    Can you provide a table showing the relationships between objective references and unit numbers.

    e.g what determines the 20 objectives you show for unit 2 from the 67 available. Make sure the table is complete for each unit number you have.

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Creating a custom filter based on a lookup table?

    Maybe something like this...

    Data Range
    A
    B
    C
    D
    E
    F
    1
    Unit 1
    Unit 2
    Unit 3
    -----
    Unit 3
    N3.4
    2
    N2.1
    N2.1
    N3.4
    N4.5
    3
    N3.2
    N3.4
    N4.5
    4


    E1 could be a data validation drop down list.

    This formula entered in F1:

    =IFERROR(T(INDEX(A$2:C$3,ROWS(F$1:F1),MATCH(E$1,A$1:C$1,0))),"")

    Copy down until you get blanks.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  12. #12
    Registered User
    Join Date
    03-15-2014
    Location
    Bedford, England
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Creating a custom filter based on a lookup table?

    Quote Originally Posted by Tony Valko View Post
    Maybe something like this...

    Data Range
    A
    B
    C
    D
    E
    F
    1
    Unit 1
    Unit 2
    Unit 3
    -----
    Unit 3
    N3.4
    2
    N2.1
    N2.1
    N3.4
    N4.5
    3
    N3.2
    N3.4
    N4.5
    4


    E1 could be a data validation drop down list.

    This formula entered in F1:

    =IFERROR(T(INDEX(A$2:C$3,ROWS(F$1:F1),MATCH(E$1,A$1:C$1,0))),"")

    Copy down until you get blanks.
    I'm not sure what you mean here. I cannot make any changes to the current format so any extra tables need to be added to a separate sheet which can later be hidden. Also, I don't need it to show me what objectives are in a unit, I need it to filter the current info to only display the objectives for that unit, if that makes sense.
    Last edited by goldenglow90; 03-16-2014 at 06:58 AM.

  13. #13
    Registered User
    Join Date
    03-15-2014
    Location
    Bedford, England
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Creating a custom filter based on a lookup table?

    Sample2.xls

    I've attached the file again with the second sheet being the exact matches of objectives to units.

    Please bear in mind that the formatting in the first sheet cannot be changed, ie. columns or rows cannot be added. This is due to the links that will be made with a master copy.

    Also, if you can do this, and it would be greatly appreciated, could you please let me know how as there are separate workbooks for each year group and set so it needs to be something I can copy and edit (I am comfortable with formulae and VB codes so neither would be an issue as long as I can adapt it for other workbooks).

    Thanks so much in advance

  14. #14
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,368

    Re: Creating a custom filter based on a lookup table?

    Maybe something like this?

    Cell D1 in sheet Number is Filter Criteria...

    Cheers
    Attached Files Attached Files

  15. #15
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Creating a custom filter based on a lookup table?

    Hi,

    Does the attached help
    Attached Files Attached Files

  16. #16
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,368

    Re: Creating a custom filter based on a lookup table?

    Im confused with category unit you provide.... some is overlapping to each other, like this:

    Unit 1: N3.1, N3.2

    with Unit 5 : N3.1, N3.2

    and some number are missing:

    Unit 1: N2.1, N2.2, N2.4 --> there is no N2.3

    Need to clarify

  17. #17
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Creating a custom filter based on a lookup table?

    @azumi

    As I understand it the definitions of which observation types (N2.1, N2.2 etc,) belong to each unit are defined on the Criteria tab.

  18. #18
    Registered User
    Join Date
    03-15-2014
    Location
    Bedford, England
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Creating a custom filter based on a lookup table?

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    Does the attached help
    That's exactly what I want. The only issue is that this is a lot of work and coding when I have 4 year groups each with a workbook for number, algebra, data and shape so is there not a possibility of doing it without all of the VBA codes and defining data ranges? The curriculum changes slightly every couple of years so the objectives often change and move between units, it needs to be something easily edited. Thanks for all your help though.
    Last edited by goldenglow90; 03-16-2014 at 04:18 PM.

  19. #19
    Registered User
    Join Date
    03-15-2014
    Location
    Bedford, England
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Creating a custom filter based on a lookup table?

    Quote Originally Posted by azumi View Post
    Maybe something like this?

    Cell D1 in sheet Number is Filter Criteria...

    Cheers
    I'm a little confused. This doesn't filter based on the criteria set out in the spreadsheet.

  20. #20
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Creating a custom filter based on a lookup table?

    Not entirely sure why you think there's a lot of work & coding. The coding after all is a mere handful of lines, and far from 'defining' data ranges as I think you mean, they are dynamic range names and the very antithesis of the defined ranges you have in mind since they adjust automatically. If you had bothered to test the scaleability by swapping observations between units you'd have no doubt seen how the system automatically adapts. Had I known you might want to add add additional units this too could have been automated so that all you would have needed to do would be to simply create a new list.

    It's now clear that the question you originally asked was not the whole story.

    It behoves all who ask questions here to tell us in advance the whole story otherwise we all waste our time putting together a solution for what we believe is a very specific arrangement rather than for a more generalised one. One which could have been put together had you bothered to mention it in the first place.

    The very fact that you mention the variability, however small, AND that you want it to be something 'easily edited' necessarily means that the solution will need to be MORE automated and hence need additional code and functionality precisely because of your desire to keep the manual effort down.

    I just wish you had mentioned the full scope in the first place. It would have been so much easier.
    Last edited by Richard Buttrey; 03-16-2014 at 05:47 PM.

+ 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. Need help creating custom sheets based on auto filter results
    By trow in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-28-2012, 04:10 PM
  2. Creating a Custom Pivot Table Report Filter
    By csivell in forum Excel General
    Replies: 0
    Last Post: 08-08-2012, 02:21 PM
  3. Creating buckets based on lookup table
    By LambChopSF in forum Excel General
    Replies: 2
    Last Post: 07-10-2012, 02:46 PM
  4. Replies: 2
    Last Post: 06-16-2011, 06:53 PM
  5. Custom order in Report Filter for Pivot table
    By papvan33 in forum Excel General
    Replies: 0
    Last Post: 04-20-2011, 04:50 AM

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