Use FILTER function to only return columns with Values

GMC The Macro Man

Board Regular
Joined
Mar 23, 2023
Messages
64
Office Version
  1. 2021
Platform
  1. Windows
Hi there
I'm using the FILTER function to look up a DataTable and return the Individual row that matches the Criteria. In this case below, the "Whole Pupil Data" page its a list of pupils and all the subjects available. They choose the subjects they want to sit and the National Level .
The ADMIN will then open the "Individual User Data" page and enter the Pupils ID number in "B3", to see what they have chosen from the 20 subjects available.
The ask from ADMIN is to see if it is possible just to return the subjects that the pupil has chosen.

If you see the attached sheet you will see that I am using the FILTER function on the ID number so that will return all the columns. The example of Yang Li has chosen ART & Design, but not Business, Chemistry, Dance or Design but has chosen Drama.. and so on.
How can I hide the columns that have not been chosen?
Thanks

Filter Book.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQAR
2Enter SCN HERE
3Pupils SCN1009516
4ID NumberForenameSurnameClassArt & DesignBusinessChemistryDanceDesignDramaEnglishFrenchGeographyGraphicsHistoryHuman BiologyItalianMathematicsModern StudiesMusicPE (SQA)PhysicsRE (SQA)Spanish
5YesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat Lvl
6IDNForenameSurnameClassAD1AD2B1B2C1C2D1D2DE1DE2DR1DR2E1E2F1F2G1G2GR1GR2H1H2HB1HB2I1I2M1M2MS1MS2MU1MU2PE1PE2PH1PH2RE1RE2S1S2
71009516YangLiS4CYes200000000Yes2Yes500Yes600Yes100Yes5Yes5Yes2Yes6Yes6000000
Individual User data
Cell Formulas
RangeFormula
A7:AR7A7=FILTER(DataInput,DataInput[IDN]=B3,"")
Dynamic array formulas.


Filter Book.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQAR
2ID NumberForenameSurnameClassArt & DesignBusinessChemistryDanceDesignDramaEnglishFrenchGeographyGraphicsHistoryHuman BiologyItalianMathematicsModern StudiesMusicPE (SQA)PhysicsRE (SQA)Spanish
3YesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat LvlYesNat Lvl
4IDNForenameSurnameClassAD1AD2B1B2C1C2D1D2DE1DE2DR1DR2E1E2F1F2G1G2GR1GR2H1H2HB1HB2I1I2M1M2MS1MS2MU1MU2PE1PE2PH1PH2RE1RE2S1S2
51009500ChaAbbS4BYes1Yes7Yes4Yes7Yes6Yes7
61009501SauAliS4BYes7Yes1Yes7Yes5Yes5Yes8Yes3Yes2
71009502MillAlS4BYes5Yes3Yes6Yes6Yes5Yes1
81009503KatAllS4BYes1Yes5Yes3Yes8Yes2Yes8Yes5Yes7Yes2Yes2
91009504ImAmS4BYes3Yes3Yes5Yes7Yes1Yes5Yes1
101009505SoAndS4BYes7Yes6Yes6Yes3
111009506SeArS4BYes7yes8Yes6Yes5Yes4Yes5Yes4
121009507NicBaS4AYes5Yes3Yes3Yes2Yes6
131009508LucBatS4AYes5Yes5Yes5Yes8Yes4Yes4Yes4Yes3Yes5
141009509JaBeaS4AYes8Yes8Yes7Yes2Yes2Yes6Yes7Yes5Yes2
151009510JoBevS4AYes2Yes4Yes7Yes3Yes6
161009511DaBlaS4AYes7yes2Yes5Yes8Yes6Yes5Yes8Yes4
171009512RaBoS4AYes8Yes7Yes6Yes6Yes5Yes4
181009513LiGrS4CYes2Yes8Yes4Yes4Yes8Yes3Yes6Yes7Yes4
191009514PiPerS4CYes4Yes4Yes5Yes1Yes6Yes6
201009515YeYengS4Cyes4Yes8Yes4Yes2Yes8Yes8Yes3Yes2
211009516YangLiS4CYes2Yes2Yes5Yes6Yes1Yes5Yes5Yes2Yes6Yes6
221009517TomHawS4CYes6Yes5Yes2Yes8
231009518LizFitzS4CYes6Yes2Yes5Yes4Yes1Yes3Yes4Yes4Yes7Yes8
241009519George MacS4CYes4Yes4Yes7Yes8Yes5Yes4Yes2
251009520MillieFitzS4DYes7Yes4Yes5Yes3Yes3Yes7Yes6Yes8
261009521OliviaTupS4DYes7yes6Yes6Yes6Yes6Yes1Yes5Yes2Yes4Yes6Yes1Yes1Yes6
271009522OllyHeadS4DYes6Yes1Yes6Yes5Yes5Yes5
281009523SarahNoseS4DYes8Yes6Yes8Yes3Yes5Yes4Yes8Yes8Yes4
291009524SophieLegS4DYes7Yes3Yes1Yes7Yes5Yes7Yes7Yes5Yes3
301009525AnnaKneeS4DYes1Yes5Yes1Yes5Yes4Yes5Yes1Yes3Yes2
311009526AnnaFootS4EYes1Yes5Yes3Yes6Yes7Yes2Yes5Yes1Yes6
321009527AvaArmS4EYes5Yes3Yes7Yes5Yes4
331009528BlakeElbowS4EYes3Yes5Yes6Yes2Yes4Yes6Yes5Yes5
Whole pupil data
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E5:AR33Cell Valuebetween 5.9 and 8.1textNO
E5:AR33Cell Value="No"textNO
E5:AR33Cell Value="Yes"textNO
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top