Forum Discussion
mpcassid
Oct 11, 2019Copper Contributor
How can I search a range of text and return value of text from first column?
I want to search a range of text (exams students have signed up for) and create a list of students who have signed up for each exam. I would like it to look similar to the table below. Can anyone recommend a formula that would complete this task?
| Name | Exam 1 | Exam 2 | Exam 3 | Exam 4 |
| Demitri | Spanish | Math | ||
| Louis | English | Music | Math | |
| Angela | Math | Spanish | ||
| Dequan | Music | Psychology | English | Math |
| Emily | Psychology | English | Math | Music |
| Spanish | Music | Math | English | Psychology |
| Demitri | Louis | Demitri | Louis | Dequan |
| Angela | Dequan | Louis | Dequan | Emily |
| Emily | Angela | |||
| Dequan | ||||
| Emily |
9 Replies
- PeterBartholomew1Silver Contributor
The following is a solution using a modern dynamic array formula
= FILTER( Name, MMULT(N(Exams=@Subject), {1;1;1;1} ) )
- srdobraisBrass Contributor
PeterBartholomew1 ¡Realmente me encanta!
- Detlef_LewinSilver Contributor
- mpcassidCopper Contributor
Thanks for the quick reply. Can you tell me how I could apply your query to my current workbook?Detlef_Lewin
- SergeiBaklanDiamond Contributor
With adding a bit of code your solution could be shortened and be independent on number of names
let Source = Tabelle1, UnpivotOtherColumns = Table.UnpivotOtherColumns(Source, {"Name"}, "Attribute", "Value"), GroupRows = Table.Group(UnpivotOtherColumns, {"Value"}, {{"Names", each [Name]}}), Result = Table.FromRows(List.Zip(GroupRows[Names]),GroupRows[Value]) in Result- mpcassidCopper Contributor
Where would this code be inserted?SergeiBaklan