SOLVED

Filtering multiple columns

%3CLINGO-SUB%20id%3D%22lingo-sub-1593572%22%20slang%3D%22en-US%22%3EFiltering%20multiple%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1593572%22%20slang%3D%22en-US%22%3EOkay%20so%20I%20have%20a%20question.%20Pretty%20much%20if%20you%20look%20at%20the%20file%20attached%2C%20what%20I%20am%20trying%20to%20accomplish%20is%20that%20when%20you%20select%20a%20certain%20job%20position%20to%20filter%2C%20I%20want%20that%20same%20job%20position%20that%E2%80%99s%20also%20in%20other%20columns%20to%20appear%20too%20and%20not%20just%20the%20one%20in%20the%20first%20selected%20column.%20Anyway%20I%20can%20make%20it%20work%3F%20What%20kinda%20code%20can%20I%20use%20if%20there%20is%20one%3F%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1593572%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1594200%22%20slang%3D%22en-US%22%3ERe%3A%20Filtering%20multiple%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1594200%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F756241%22%20target%3D%22_blank%22%3E%40RajGrewal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20it%20possible%20for%20you%20to%20post%20the%20actual%20spreadsheet%20rather%20than%20an%20image%3F%20Otherwise%20you're%20asking%20us%20to%20create%20our%20own....just%20remove%20any%20names%20(if%20those%20are%20what's%20in%20Column%20A)%20or%20any%20other%20confidential%20info.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1594357%22%20slang%3D%22en-US%22%3ERe%3A%20Filtering%20multiple%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1594357%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F756241%22%20target%3D%22_blank%22%3E%40RajGrewal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere's%20the%20result.%20%3CEM%3EYou%20do%20need%20to%20have%20the%20most%20recent%20release%20of%20Excel%20in%20order%20for%20this%20to%20function.%3C%2FEM%3E%20It%20makes%20use%20of%20the%20%3CSTRONG%3EFILTER%3C%2FSTRONG%3E%20function%2C%20with%20a%20long%20set%20of%20criteria%2C%20given%20the%20number%20of%20columns%20you%20have.%20The%20key%20to%20accomplishing%20what%20you%20want%20is%20the%20%22%2B%22%20sign%20between%20each%20of%20the%20criterion%20statements.%20It%20translates%20to%20Excel%20as%20%22or%22.%3C%2FP%3E%3CP%3EAttached%20is%20an%20example%20of%20how%20you%20can%20work%20with%20the%20data%20arrayed%20as%20you%20have%20it%20currently.%20There's%20a%20single%20formula%20in%20cell%20A7%20of%20the%20newly%20created%20%22Filter%22%20worksheet.%20On%20the%20%22DataValTable%22%20sheet%2C%20I%20created%20a%20list%20of%20unique%20position%20titles%2C%20to%20use%20in%20the%20selection%20drop%20down%20on%20the%20Filter%20worksheet.%20You%20select%20the%20position%20title%20you%20want%20to%20search%20for%20in%20cell%20A3%2C%20and%20it%20becomes%20the%20basis%20for%20looking%20at%20every%20column%20that%20contains%20position%20titles.%20The%20FILTER%20function%20is%20a%20long%20one%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3DFILTER(Database!A2%3AAP140%2C%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3E(Database!A2%3AA140%3D%24A%243)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3E%2B(Database!G2%3AG140%3D%24A%243)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3E%2B(Database!M2%3AM140%3D%24A%243)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3E%2B(Database!S2%3AS140%3D%24A%243)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3E%2B(Database!Y2%3AY140%3D%24A%243)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3E%2B(Database!AE2%3AAE140%3D%24A%243)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20class%3D%22lia-indent-padding-left-30px%22%3E%3CSTRONG%3E%2B(Database!AK2%3AAK140%3D%24A%243)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20not%20sure%20whether%20indeed%20names%20were%20in%20your%20original%2C%20and%20if%20you%20use%20the%20yellow%20rows%20to%20differentiate%20between%20individuals.%20There%20would%20be%20better%20ways%20to%20do%20this%2C%20from%20the%20point%20of%20view%20of%20database%20design.%20You%20have%20a%20lot%20of%20empty%20cells%2C%20meaning%20a%20lot%20of%20wasted%20space.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20depending%20on%20where%20you're%20going%20with%20this%2C%20we%20could%20talk%20about%20better%20design.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1594463%22%20slang%3D%22en-US%22%3ERe%3A%20Filtering%20multiple%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1594463%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F756241%22%20target%3D%22_blank%22%3E%40RajGrewal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETake%20that%20sheet%20with%20actual%20names%20down.%20It's%20a%20violation%20of%20the%20rules%20here%20to%20post%20real%20info...privacy%20rules.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAll%20you%20need%20to%20do%20to%20use%20what%20I%20gave%20you%20is%20modify%20the%20array%20that%20gets%20filtered%2C%20along%20with%20the%20columns%20specifying%20the%20criteria.%20I%20can't%20do%20it%20now%2C%20but%20will%20look%20later%20this%20evening.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1594476%22%20slang%3D%22en-US%22%3ERe%3A%20Filtering%20multiple%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1594476%22%20slang%3D%22en-US%22%3EOkay%20thanks%2C%20sorry%20will%20do%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1594434%22%20slang%3D%22en-US%22%3ERe%3A%20Filtering%20multiple%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1594434%22%20slang%3D%22en-US%22%3E%3CP%3EYes%20that%E2%80%99s%20very%20helpful!%20I%20really%20appreciate%20it.%20I%E2%80%99m%20new%20and%20my%20boss%20gave%20me%20this%20so%20I%20am%20struggling.%20I%20would%20like%20a%20good%20way%20to%20design%20and%20set%20it%20up%20too.%20I%20will%20include%20the%20file%20in%20this%20with%20the%20names%20also%20if%20you%20don%E2%80%99t%20mind%20showing%20me%20how%20do%20that.%20I%20really%20appreciate%20the%20help%20in%20helping%20me%20learn.%20That%E2%80%99s%20the%20full%20actual%20sheet%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1594767%22%20slang%3D%22en-US%22%3ERe%3A%20Filtering%20multiple%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1594767%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F756241%22%20target%3D%22_blank%22%3E%40RajGrewal%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20added%20a%20column%20for%20the%20names%20---%20you%20can%20just%20copy%20and%20paste%20them%20in%20on%20the%20data%20base.%20The%20formula%20has%20been%20adjusted%20to%20accommodate%20the%20additional%20data.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1594814%22%20slang%3D%22en-US%22%3ERe%3A%20Filtering%20multiple%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1594814%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F425987%22%20target%3D%22_blank%22%3E%40mathetes%3C%2FA%3E%26nbsp%3Bthank%20you%20so%20much!%20really%20appreciate%20the%20help%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1594252%22%20slang%3D%22en-US%22%3ERe%3A%20Filtering%20multiple%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1594252%22%20slang%3D%22en-US%22%3E%3CP%3EYes%20here%20is%20the%20actual%20file%20without%20names%2C%20if%20there%20is%20any%20other%20way%20to%20set%20it%20up%2C%20I%20would%20appreciate%20that%20too.%20Thanks%20for%20looking%20into%20it%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1596709%22%20slang%3D%22en-US%22%3ERe%3A%20Filtering%20multiple%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1596709%22%20slang%3D%22en-US%22%3EHello%2C%20%3CBR%20%2F%3E%3CBR%20%2F%3EI've%20removed%20all%20attachments%20due%20to%20raised%20security%20%26amp%3B%20GDPR%20concerns.%20Thank%20you.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1599132%22%20slang%3D%22en-US%22%3ERe%3A%20Filtering%20multiple%20columns%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1599132%22%20slang%3D%22en-US%22%3EJust%20found%20at%20that%20at%20my%20workplace%20they%20are%20still%20using%20excel%202007..%20smh%20so%20that%20filter%20function%20didn%E2%80%99t%20work%20there.%20Thanks%20for%20the%20help%20either%20way%2C%20appreciate%20it.%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Okay so I have a question. Pretty much if you look at the file attached, what I am trying to accomplish is that when you select a certain job position to filter, I want that same job position that’s also in other columns to appear too and not just the one in the first selected column. Anyway I can make it work? What kinda code can I use if there is one?

10 Replies
Highlighted

@RajGrewal 

 

Is it possible for you to post the actual spreadsheet rather than an image? Otherwise you're asking us to create our own....just remove any names (if those are what's in Column A) or any other confidential info.

Highlighted

Yes here is the actual file without names, if there is any other way to set it up, I would appreciate that too. Thanks for looking into it

Highlighted

@RajGrewal 

 

Here's the result. You do need to have the most recent release of Excel in order for this to function. It makes use of the FILTER function, with a long set of criteria, given the number of columns you have. The key to accomplishing what you want is the "+" sign between each of the criterion statements. It translates to Excel as "or".

Attached is an example of how you can work with the data arrayed as you have it currently. There's a single formula in cell A7 of the newly created "Filter" worksheet. On the "DataValTable" sheet, I created a list of unique position titles, to use in the selection drop down on the Filter worksheet. You select the position title you want to search for in cell A3, and it becomes the basis for looking at every column that contains position titles. The FILTER function is a long one;

=FILTER(Database!A2:AP140,

(Database!A2:A140=$A$3)

+(Database!G2:G140=$A$3)

+(Database!M2:M140=$A$3)

+(Database!S2:S140=$A$3)

+(Database!Y2:Y140=$A$3)

+(Database!AE2:AE140=$A$3)

+(Database!AK2:AK140=$A$3)

)

 

I'm not sure whether indeed names were in your original, and if you use the yellow rows to differentiate between individuals. There would be better ways to do this, from the point of view of database design. You have a lot of empty cells, meaning a lot of wasted space.

 

So depending on where you're going with this, we could talk about better design.

Highlighted

Yes that’s very helpful! I really appreciate it. I’m new and my boss gave me this so I am struggling. I would like a good way to design and set it up too. I will include the file in this with the names also if you don’t mind showing me how do that. I really appreciate the help in helping me learn. That’s the full actual sheet

Highlighted
Best Response confirmed by RajGrewal (Occasional Contributor)
Solution

@RajGrewal 

 

Take that sheet with actual names down. It's a violation of the rules here to post real info...privacy rules.

 

All you need to do to use what I gave you is modify the array that gets filtered, along with the columns specifying the criteria. I can't do it now, but will look later this evening.

Highlighted
Okay thanks, sorry will do
Highlighted

@RajGrewal 

 

I've added a column for the names --- you can just copy and paste them in on the data base. The formula has been adjusted to accommodate the additional data.

Highlighted

@mathetes thank you so much! really appreciate the help

Highlighted
Hello,

I've removed all attachments due to raised security & GDPR concerns. Thank you.
Highlighted
Just found at that at my workplace they are still using excel 2007.. smh so that filter function didn’t work there. Thanks for the help either way, appreciate it.