+ Reply to Thread
Results 1 to 18 of 18

Filtering by one column based on values in another

  1. #1
    Registered User
    Join Date
    09-19-2012
    Location
    PPPP
    MS-Off Ver
    Professional Plus 2016
    Posts
    26

    Filtering by one column based on values in another

    I all, hoping someone can help me with this one...

    So I've got a table that contains a list of materials required for a project, essentially similar to this:

    table.png

    What I want to do is to display all material for lines with (for example) PVC pipe as one of the materials.

    The result of this filter would be:

    table1.png

    So it lists all the materials for drawing numbers that contain "PVC pipe" as one of the materials.

    Is there a simple way to do this without adding additional rows or using macros? On top of that - is there a way to also filter this way using a pivot table?

    Any help is greatly appreciated!

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Filtering by one column based on values in another

    Hi mightyr,

    Welcome to the forum

    Please attach sample file with source data and pivot tables for giving exact solution


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    09-19-2012
    Location
    PPPP
    MS-Off Ver
    Professional Plus 2016
    Posts
    26

    Re: Filtering by one column based on values in another

    Hi Sixthsense, thanks for the reply... unfortunately I can't post the exact spreadsheet I'm working on as it contains information for a construction project which I really shouldn't share... I can though post the simplified example I posted a screen shot of above if that works?

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Filtering by one column based on values in another

    We never request you to attach a confidential data, please just fill x,y,z of data to cover logic

  5. #5
    Registered User
    Join Date
    09-19-2012
    Location
    PPPP
    MS-Off Ver
    Professional Plus 2016
    Posts
    26

    Re: Filtering by one column based on values in another

    OK no worries, see attached simplified version. Thanks for your help!
    Attached Files Attached Files

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Filtering by one column based on values in another

    Check the attachment and confirm whether this helps
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-19-2012
    Location
    PPPP
    MS-Off Ver
    Professional Plus 2016
    Posts
    26

    Re: Filtering by one column based on values in another

    Hey sixthsense, yep that works great... but as I said in my first post I can't add any columns to my spreadsheet, as my actual spreadsheet contains around 40 columns including hidden columns and adding a column will affect my macros etc....

    Is there any other way to do this?

    Again thanks for your help!

    Edit: Btw - Your solution falls down if the 'material' you're looking for is not the first material listed for each 'drawing number'. Eg. with the same table if you wanted to complete the same operation with value say "Flange Type A'.
    Last edited by mightyr; 06-06-2013 at 06:02 AM.

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Filtering by one column based on values in another

    Sorry I don't have any other suggestion

  9. #9
    Registered User
    Join Date
    09-19-2012
    Location
    PPPP
    MS-Off Ver
    Professional Plus 2016
    Posts
    26

    Re: Filtering by one column based on values in another

    Is it possible to filter a column by setting a range of cells as the criteria? If this was possible I could first filter the cells by 'Material' type, then copy the relevant visible "drawing number" cells to another sheet. Then, clear my current material filter and filter "drawing number" by the copied range. This could be done fairly easily with a macro, though I'm not sure it can be done without. Also I wouldn't know how to use that on a pivot table without copying visible cells to another sheet and creating a whole new pivot table.

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Filtering by one column based on values in another

    You can use the filtering ability of the table.

    Click the filer button on the Drawing Number and sort the drawings in numeric order. Then click again on the filter button for the Drawing Number and de-select All and select 1 and 3 and you will have duplicated the outcome in the picture that you posted.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  11. #11
    Registered User
    Join Date
    09-19-2012
    Location
    PPPP
    MS-Off Ver
    Professional Plus 2016
    Posts
    26

    Re: Filtering by one column based on values in another

    ^The above manual selection methods works great if you have three drawing numbers with 5 materials each... but my actual spreadsheet has hundreds of drawings with up to 20 materials each. I want to filter to show all materials of all drawings that have "PVC" as one of the materials.

  12. #12
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Filtering by one column based on values in another

    Filtering by materials and choosing for example PVC won't do what you want?

  13. #13
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Filtering by one column based on values in another

    Filtering by materials and choosing for example PVC won't do what you want?

  14. #14
    Registered User
    Join Date
    09-19-2012
    Location
    PPPP
    MS-Off Ver
    Professional Plus 2016
    Posts
    26

    Re: Filtering by one column based on values in another

    I need to show all materials for drawings numbers that have PVC as one of the materials. If I filter by materials an choose PVC this will show the drawing numbers that have PVC as one of the materials but it obviously won't have the other materials for these drawings.

  15. #15
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Filtering by one column based on values in another

    You can filter on as many of the materials as you like leaving out the ones that are not of interest. It isn't a case of choose one or choose all.

  16. #16
    Registered User
    Join Date
    09-19-2012
    Location
    PPPP
    MS-Off Ver
    Professional Plus 2016
    Posts
    26

    Re: Filtering by one column based on values in another

    As I said earlier I have hundreds of drawings and thousands of materials - filtering manually is not an option.

  17. #17
    Registered User
    Join Date
    09-19-2012
    Location
    PPPP
    MS-Off Ver
    Professional Plus 2016
    Posts
    26

    Re: Filtering by one column based on values in another

    I don't think you understand the question... All materials are of interest! It's the drawing numbers I want to filter... but I want to show all the materials of drawings that have a specific material (in this case PVC) as one of their (many) materials. If a drawing doesn't have PVC as one of it's materials, I want to hide that drawing number and all of its materials. If I filter materials and choose "PVC" it will show the drawing numbers I am interested in, but it will hide the other materials for those specific drawings that I am also needing to view. I could reset the filter then go through and manually select the drawing numbers... but if there are hundreds of drawings in this list this will be rather time consuming task.

  18. #18
    Registered User
    Join Date
    09-19-2012
    Location
    PPPP
    MS-Off Ver
    Professional Plus 2016
    Posts
    26

    Re: Filtering by one column based on values in another

    OK I figured a way to do it if anyone is interested... not the most elegant solution but it works and is easy.

    Basically you need to make a dummy row. For this row make the value for 'Drawing number' anything eg. "Dummy" then make the value for material "PVC". Next filter materials so that only "PVC" is showing. Now go to the filter for 'drawing number' and uncheck "Dummy". Now go back to the filter for materials and click 'select all'. Done! Now the only way I can think to do a pivot table with this info is to copy the visible cells into a new sheet.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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