Forum Discussion
Help with with Lookups etc.
Hi
I’m looking for help as I’ve exhausted my knowledge and cannot sort this out.
I have a spreadsheet with columns A-L. The sheet goes from A2:L90 (see attachment)
Columns A and B are surname and first name. Columns C and G:H contain the roles held by those people. They may have several roles. A particular role may be in any of those six columns. All the different roles have their own individual empty worksheet, with a tab naming the role, that will hold the data found in the LookUp exercise.
I want to have a macro that enables me to click on a role name (e.g. “Band Member” or “Role A”) from a dropdown list containing all the different roles.
Then I need a function (I have tried HLookup, VLookup and Xlookup with no success, but I’m obviously doing something wrong) that can look across the master spreadsheet, and identify, say, all band members (or whatever role I click on from the dropdown list) that have that role shown in any of the columns C or G-K.
It then needs to copy those names onto (in this case) the “Band Leader” worksheet (see attachment).
I’m totally flummoxed on how to do this after hours of trying to the best of my limited ability. I would be most grateful to be pointed in the right direction.
5 Replies
- SnowMan55Bronze Contributor
If you do not have Excel 365 or Excel for the web, this may still be possible. (And macros are to be avoided if possible.)
If you have Excel 2021 or a later version, see the attached workbook. (If you do not have Excel 365 or Excel for the web, you will probably need to remove the Data Validation from the input cell (D2) on the Demo worksheet.)
Edited: Yet another example of when I attached a file, but the forum software dropped it.
- LesKingBrass Contributor
Hi SnowMan55,
This looks very professional. I'll try it out tomorrow.
Thank you.
- m_tarlerBronze Contributor
Here are 2 options:
=FILTER(ROLES!A1:L90,MMULT(--("Role A"=ROLES!C1:K90),SEQUENCE(COLUMNS(ROLES!C1:K90),1,1,0)),"none")or
=FILTER(ROLES!A1:L90,BYROW(ROLES!C1:K90,LAMBDA(r,ISNUMBER(XMATCH("Role B",r)))),"none")in each case the ranges and roles can be updated as needed.
instead of different tabs for each Role you could have 1 tab and have a drop down on that sheet for which role to show.
- LesKingBrass Contributor
Hi,
Both of these formulas achieve what I want in terms of isolating the roles I need. I'll also try and use only one tab as you suggest
Thanks very much!
- LesKingBrass Contributor
Hi,
Both of these do what I need in terms of isolating the "Band Members". I'll also try the suggestion of only having one tab.
Thanks very much.