Drop down list of users name in columns in order to reference a corresponding cell

sedwardson

New Member
Joined
Mar 2, 2023
Messages
35
Office Version
  1. 365
Platform
  1. Windows
Hopefully the title isn't too confusing but here is my question. I have a small spreadsheet with users names in columns and then a list of mapped drives above the users names. What I would like to do is have a drop down list (or open to another solution) to select a users name and then in the cell to the right of it, tell me which mapped drives that user is entitled to. The user will only appear once in each column so there shouldn't be any duplicates.

Here is my table to demonstrate what I am trying to achieve (obviously names taken out and replaced for example). I would like to drop down the list of users and select an individual and next to it I would like it to tell me what drive letters (mapped drives) need applying to them.

Drive lettersIMH, I, J, K, LH, J, LDrop Down List of UsersDrives To Be Mapped
MembersUser 1User 19User 24User 29
User 2User 20User 25User 30
User 3User 21User 26User 31
User 4User 22User 27
User 5User 23User 28
User 6
User 7
User 8
User 9
User 10
User 11
User 12
User 13
User 14
User 15
User 16
User 17
User 18

Many thanks for all and any help.

Kind regards

Sam
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
you can probably do this a better way

365 version


i would make a column for the users and use
=LET(v,VSTACK(B3:B200,C3:C200,D3:D200,E3:E200),FILTER(v,v<>""))
to create the list for data validation

then use list in datavalidation - choose the range and ignore blanks ticked

then in H3
use
=INDEX($B$1:$E$1,AGGREGATE(15,6,(COLUMN($B$1:$E$1)-COLUMN($B$1)+1)/($B$2:$E$200=G3),1))

i have used the range to 200

Book7
ABCDEFGHIJK
1Drive lettersIMH, I, J, K, LH, J, LDrop Down List of UsersDrives To Be Mapped
2User 1
3MembersUser 1User 19User 24User 29User 28H, I, J, K, LUser 2
4User 2User 20User 25User 30User 3
5User 3User 21User 26User 31User 4
6User 4User 22User 27User 5
7User 5User 23User 28User 6
8User 6User 7
9User 7User 8
10User 8User 9
11User 9User 10
12User 10User 11
13User 11User 12
14User 12User 13
15User 13User 14
16User 14User 15
17User 15User 16
18User 16User 17
19User 17User 18
20User 18User 19
21User 20
22User 21
23User 22
24User 23
25User 24
26User 25
27User 26
28User 27
29User 28
30User 29
31User 30
32User 31
33
34
Sheet1
Cell Formulas
RangeFormula
K2:K32K2=LET(v,VSTACK(B3:B200,C3:C200,D3:D200,E3:E200),FILTER(v,v<>""))
H3H3=INDEX($B$1:$E$1,AGGREGATE(15,6,(COLUMN($B$1:$E$1)-COLUMN($B$1)+1)/($B$2:$E$200=G3),1))
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
I2Custom=LET(v,VSTACK(B3:B20,C3:C20,D3:D20,E3:E20),FILTER(v,v<>""))
G3List=$K$2:$K$68


also on share dropbox for a few days
 
Upvote 0
you could also use this to lookup the header value
=INDEX($B$1:$E$1,MIN(IF(B2:E25=G3,COLUMN(B2:E25)-COLUMN(B2)+1)))
instead of the aggregate

lookup - header from grid - ETAF.xlsx
ABCDEFGHIJK
1Drive lettersIMH, I, J, K, LH, J, LDrop Down List of UsersDrives To Be MappedOR
2User 1
3MembersUser 1User 19User 24User 29User 28H, I, J, K, LH, I, J, K, LUser 2
4User 2User 20User 25User 30User 3
5User 3User 21User 26User 31=INDEX($B$1:$E$1,AGGREGATE(15,6,(COLUMN($B$1:$E$1)-COLUMN($B$1)+1)/($B$2:$E$200=G3),1))=INDEX($B$1:$E$1,MIN(IF(B2:E25=G3,COLUMN(B2:E25)-COLUMN(B2)+1)))User 4
6User 4User 22User 27User 5
7User 5User 23User 28User 6
8User 6User 7
9User 7User 8
10User 8User 9
11User 9User 10
12User 10User 11
13User 11User 12
14User 12User 13
15User 13User 14
16User 14User 15
17User 15User 16
18User 16User 17
19User 17User 18
20User 18User 19
21User 20
22User 21
23User 22
24User 23
25User 24
26User 25
27User 26
28User 27
29User 28
30User 29
31User 30
32User 31
33
34
35
TEXT-LU
Cell Formulas
RangeFormula
K2:K32K2=LET(v,VSTACK(B3:B200,C3:C200,D3:D200,E3:E200),FILTER(v,v<>""))
H3H3=INDEX($B$1:$E$1,AGGREGATE(15,6,(COLUMN($B$1:$E$1)-COLUMN($B$1)+1)/($B$2:$E$200=G3),1))
I3I3=INDEX($B$1:$E$1,MIN(IF(B2:E25=G3,COLUMN(B2:E25)-COLUMN(B2)+1)))
H5:I5H5=FORMULATEXT(H3)
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
I2Custom=LET(v,VSTACK(B3:B20,C3:C20,D3:D20,E3:E20),FILTER(v,v<>""))
G3List=$K$2:$K$68
 
Upvote 0
you can probably do this a better way

365 version


i would make a column for the users and use
=LET(v,VSTACK(B3:B200,C3:C200,D3:D200,E3:E200),FILTER(v,v<>""))
to create the list for data validation

then use list in datavalidation - choose the range and ignore blanks ticked

then in H3
use
=INDEX($B$1:$E$1,AGGREGATE(15,6,(COLUMN($B$1:$E$1)-COLUMN($B$1)+1)/($B$2:$E$200=G3),1))

i have used the range to 200

Book7
ABCDEFGHIJK
1Drive lettersIMH, I, J, K, LH, J, LDrop Down List of UsersDrives To Be Mapped
2User 1
3MembersUser 1User 19User 24User 29User 28H, I, J, K, LUser 2
4User 2User 20User 25User 30User 3
5User 3User 21User 26User 31User 4
6User 4User 22User 27User 5
7User 5User 23User 28User 6
8User 6User 7
9User 7User 8
10User 8User 9
11User 9User 10
12User 10User 11
13User 11User 12
14User 12User 13
15User 13User 14
16User 14User 15
17User 15User 16
18User 16User 17
19User 17User 18
20User 18User 19
21User 20
22User 21
23User 22
24User 23
25User 24
26User 25
27User 26
28User 27
29User 28
30User 29
31User 30
32User 31
33
34
Sheet1
Cell Formulas
RangeFormula
K2:K32K2=LET(v,VSTACK(B3:B200,C3:C200,D3:D200,E3:E200),FILTER(v,v<>""))
H3H3=INDEX($B$1:$E$1,AGGREGATE(15,6,(COLUMN($B$1:$E$1)-COLUMN($B$1)+1)/($B$2:$E$200=G3),1))
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
I2Custom=LET(v,VSTACK(B3:B20,C3:C20,D3:D20,E3:E20),FILTER(v,v<>""))
G3List=$K$2:$K$68


also on share dropbox for a few days

Hi @etaf, Thanks for your hard work. I used your first solution (i'll try the second perhaps after you've read this). I have applied it to my spreadsheet and it works ! :-) Unfortunately, I have been given more names to add to the list and there are some duplicate names now in some of the columns. For example I have a few people that are now in both column column B as well as E, and one that is in column column C and D. If you're able to work your magic further I would be very appreciative but I realise that this is probably now a much harder question !
 
Upvote 0
I did things a little differently. I rearranged your data to utilize the INDEX & MATCH functions and Data Validation List more efficiently. I also gave the people names. With this method, you can add people, you can move all your information to a separate hidden sheet, you can do many things. You'd have to adjust a little with your indexing, unless you set up the area with excess.

1698774799095.png


The Code for the Drives To Be Mapped Column is:

VBA Code:
=IFERROR(IF(INDEX($E$1:$E$42, MATCH(A2, $D$1:$D$42, 0))= 0,"", INDEX($E$1:$E$42, MATCH(A2, $D$1:$D$42, 0))),"")

1698775111580.png

Essentially, this is indexing your list of names, matching them to the selection in the dropdown, taking the value if there is one and returning it to the Drives To Be Mapped cell next to it. If there's no data, it will return a blank. I used the "$" to maintain the code for drag extending the code down.

Hope this helps!
 
Upvote 0
I did things a little differently. I rearranged your data to utilize the INDEX & MATCH functions and Data Validation List more efficiently. I also gave the people names. With this method, you can add people, you can move all your information to a separate hidden sheet, you can do many things. You'd have to adjust a little with your indexing, unless you set up the area with excess.

View attachment 101281

The Code for the Drives To Be Mapped Column is:

VBA Code:
=IFERROR(IF(INDEX($E$1:$E$42, MATCH(A2, $D$1:$D$42, 0))= 0,"", INDEX($E$1:$E$42, MATCH(A2, $D$1:$D$42, 0))),"")

View attachment 101282
Essentially, this is indexing your list of names, matching them to the selection in the dropdown, taking the value if there is one and returning it to the Drives To Be Mapped cell next to it. If there's no data, it will return a blank. I used the "$" to maintain the code for drag extending the code down.

Hope this helps!
Hi @Royalbloodi , Thanks for your reply. Will this work if a user has two sets of mapped drives? Previously I said that there wouldnt be any duplicate names in any of the columns but this is now not the case (see previous entry in thread). Thanks for all your hard work. Sam
 
Upvote 0
Hi @Royalbloodi , Thanks for your reply. Will this work if a user has two sets of mapped drives? Previously I said that there wouldnt be any duplicate names in any of the columns but this is now not the case (see previous entry in thread). Thanks for all your hard work. Sam
I'm sure this could be modified to suit that, but you also could simply just put all the letters for whatever drives they'd need next to their name in the information list. Essentially, consolidate the users names so they don't have more than one data entry. I hope I'm understanding your comment correctly.
 
Upvote 0
I'm sure this could be modified to suit that, but you also could simply just put all the letters for whatever drives they'd need next to their name in the information list. Essentially, consolidate the users names so they don't have more than one data entry. I hope I'm understanding your comment correctly.

I've created a file of some ideas for you. This will allow you to type in your employee's names on an information sheet, it will sort and highlight any duplicates in the next column. At that point you can use your data entry column to delete and consolidate any duplicates. The third column will merge all names of the employee for single-cell reference. On the Lookup Sheet, you have 25ish available and numbered blanks with the dropdown lists for pulling up your employees. It will auto-populate the drives to be mapped to the right of the named list.

Note: In the Information sheet, only modify the first column for adding, modifying and deleting employee names. The other two columns are controlled by Formulae and Conditional formatting.

Download DrivesToBeMapped.xlsx Here.

I hope this helps! :)
 
Upvote 0
Borrowing etaf's idea how about
Fluff.xlsm
ABCDEFGHIJK
1Drive lettersIMH, I, J, K, LH, J, LDrop Down List of UsersDrives To Be MappedOR
2User 1
3MembersUser 1User 19User 24User 29User 28M, H, I, J, K, LM, H, I, J, K, LUser 2
4User 2User 20User 25User 30User 3
5User 3User 21User 26User 31User 4
6User 4User 22User 27User 5
7User 5User 23User 28User 6
8User 6User 28User 7
9User 7User 8
10User 8User 9
11User 9User 10
12User 10User 11
13User 11User 12
14User 12User 13
15User 13User 14
16User 14User 15
17User 15User 16
18User 16User 17
19User 17User 18
20User 18User 19
21User 20
22User 21
23User 22
24User 23
25User 28
26User 24
27User 25
28User 26
29User 27
30User 29
31User 30
32User 31
33
Sheet4
Cell Formulas
RangeFormula
K2:K32K2=UNIQUE(TOCOL(B3:E100,1,1))
H3H3=TEXTJOIN(", ",,INDEX($B$1:$E$1,AGGREGATE(15,6,(COLUMN($B$1:$E$1)-COLUMN($B$1)+1)/($B$2:$E$200=G3),SEQUENCE(COUNTIFS(B2:E200,G3)))))
I3I3=TEXTJOIN(", ",,INDEX($B$1:$E$1,SMALL(IF(B2:E100=G3,COLUMN(B2:E100)-COLUMN(B2)+1),SEQUENCE(COUNTIFS(B2:E100,G3)))))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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