Can I search multiple columns for a specific word and every time it appears get the data from that row?

cmstoren

New Member
Joined
Oct 31, 2024
Messages
2
Office Version
  1. 365
Platform
  1. MacOS
Hey - I have spreadsheet with a list of student names and the subjects they have chosen for the year. I'd like to be able to create a search cell where I could type in the subject and the name and surname of all the students that have chosen that subject appear. I can't upload the actual sheet so I've made a much smaller version so you can hopefully see what I'm asking.
 

Attachments

  • Screenshot 2024-11-02 at 8.21.29 PM.png
    Screenshot 2024-11-02 at 8.21.29 PM.png
    251.3 KB · Views: 5

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Welcome to the MrExcel board!

For the future I suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with.
(If you have trouble with XL2BB, review the "XL2BB Icons greyed out" link in the 'Known XL2BB issues' section near the top of the XL2BB Instructions page linked above.)

See if this might work for you (check the table name)

cmstoren.xlsm
ABCDEFGHIJKLM
1SurnameNameYear123456Biology
2Sname 1Fname 1BiologyChemistrySname 1Fname 1
3Sname 2Fname 2PESname 3Fname 3
4Sname 3Fname 3HealthBiologySname 4Fname 4
5Sname 4Fname 4HealthBiologySname 5Fname 5
6Sname 5Fname 5Biology
7Sname 6Fname 6Computing
Sheet1
Cell Formulas
RangeFormula
L2:M5L2=TEXTSPLIT(TEXTJOIN("|",1,IF(Table1[[1]:[6]]=L1,Table1[Surname]&";"&Table1[Name],"")),";","|")
Dynamic array formulas.
 
Upvote 0
You are welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,223,608
Messages
6,173,325
Members
452,510
Latest member
RCan29

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