Excel Data Validation

rwe1187

New Member
Joined
Jun 1, 2021
Messages
34
Office Version
  1. 365
Platform
  1. Windows
So I am not sure if this is possible. I want to use Data Validation to work the following:

Let's say I have a sheet with a list of lockers. This is the LOCKERS sheet. All the locker numbers are listed in column A. In column B there is Assigned/Status. This column has one of the following for each locker number: A name that the locker is assigned to...or the word BROKEN which means they are unavailable....or the word OPEN which means they are available. Column C is the shift number which is not really important for this. On the sheet I want to use Data Validation, which we will call employee tracking, I would like a drop down list displaying only the locker numbers that are available. On this sheet is also a list of employees. So as I assign the lockers on the EMPLOYEE TRACKING sheet the LOCKERS sheet will have to update somehow so that the proper lockers are shown in the data validation drop down menu.

Sound like something that can work?
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
is this what you mean?
----------------------
Excel Data Validation Lockers.xlsx
ABC
1Locker NumberAssigned/Statusshift number
21Liam
32Noah
43Oliver
54Theodore
65Olivia
76Broken
87Emma
98Open
109Open
1110Open
1211Open
1312Open
1413Open
1514Charlotte
1615Broken
1716Sophia
1817Open
1918Evelyn
2019Open
2120Open
LOCKERS
Cell Formulas
RangeFormula
B2B2=IF(MATCH(LOCKERS!A2,'EMPLOYEE TRACKING'!B:B,0)=TRUE,"Open",XLOOKUP(LOCKERS!A2,'EMPLOYEE TRACKING'!B:B,'EMPLOYEE TRACKING'!A:A))
B3:B6,B17:B21,B8:B15B3=IFERROR(IF(MATCH(LOCKERS!A3,'EMPLOYEE TRACKING'!B:B,0)=TRUE,"Open",XLOOKUP(LOCKERS!A3,'EMPLOYEE TRACKING'!B:B,'EMPLOYEE TRACKING'!A:A)),"Open")

----------------------
Excel Data Validation Lockers.xlsx
ABCD
1NameLocker NumberOpen Locker Numbers
2Liam18
3Noah29
4Oliver310
5Elijah11
6James12
7William13
8Benjamin17
9Lucas19
10Henry 
11Theodore4 
12Olivia5 
13Emma7 
14Charlotte14 
15Amelia 
16Ava 
17Sophia16 
18Isabella 
19Mia 
20Evelyn18 
21Harper 
EMPLOYEE TRACKING
Cell Formulas
RangeFormula
D2:D21D2=IFERROR(INDEX(LOCKERS!A2:A21,SMALL(IF("Open"=LOCKERS!B2:B21,ROW(LOCKERS!B2:B21)-ROW(LOCKERS!B2)+1),ROW(LOCKERS!1:1))),"")
Cells with Data Validation
CellAllowCriteria
B3:B21List=$D$2:$D$21
 
Upvote 0
Thanks for the input. But, I am not sure this is what I am looking for, and I can already tell that I will get frustrated trying to explain it. Let me try one more time, and then I will call it quits.

Two sheets: Lockers & Employee Tracking

LOCKERS sheet has column A with cells that have locker numbers that remain constant.
LOCKERS sheet has column B with cells that have Assignment or status that can change. There is a drop down menu where you can choose either AVAILABLE or BROKEN or you can simply have an employee's name that the locker number was assigned to. This can change as employees come and go and as lockers change status - AVAILABLE ones become BROKEN and BROKEN ones are fixed and become AVAILABLE.

EMPLOYEE TRACKING sheet has column A that has the employee's name that will be entered.
EMPLOYEE TRACKING sheet has column C that has employee's end date that will be entered.
EMPLOYEE TRACKING sheet has column M that has LOCKER NUMBER. In column M, I would like a drop down list where only a list of lockers that are AVAILABLE from the LOCKERS sheet, appears. As the lockers on the LOCKERS sheet change from AVAILABLE to BROKEN or are assigned they would not display in the cells in column M. As they change from BROKEN to AVAILABLE or when an employee leaves and they become AVAILABLE they would appear in the drop down list in column M.

I would like column B on the LOCKERS sheet to update automatically with the name of the employee from the EMPLOYEE TRACKING sheet as the lockers are assigned. Also have the ability to enter the status in column B on the lockers sheet as BROKEN as lockers become broken or AVAILABLE will show if a date is entered in column C on the EMPLOYEE TRACKING sheet.

This probably sounds so confusing. It is easier to show someone vs typing an explanation. I understand if it cannot be done. I actually am sure it can be accomplished, just maybe not with my explanation LOL.

So an example would be:

On the Lockers page there are lockers 1-5. Column B shows1-4 as available and 5 as broken (manually keyed in as broken).
On the Employee Tracking sheet, I enter Rosa G as the employee....work my way to column M and a drop down menu appears showing lockers (Either can be 1-4 since they are the only ones available or 1-5 maybe in black and 5 in red since it is broken and cannot be chosen). I choose locker 1 for Rosa. If I go back to the lockers sheet, locker 1 now shows as Rosa G (not available or broken). Back to the employee tracking sheet. Employee number 2 is John R. I move to column M and now lockers 2-4 appear (locker 1 belongs to Rosa and does not show and locker 5 is broken). John R gets locker 2. Back on the lockers page locker 2 now shows as John R. later on Rosa has an end date entered in column C on employee tracker. Back on the locker sheet locker 1 now shows as Available. I go to enter Larry Smith as a new employee and in column M locker 1 is now available again. And this keeps happening.

I hope this was enough, yet not too much.
 
Upvote 0
ok... so i think i've got a solution for you if you can make a few edits to your sheet...
-will need a helper list somewhere for the lockers numbers available- i added a "hidden" sheet to have this on
-add a separate status column on the lockers page
----------------
Excel Data Validation Lockers.xlsx
ABC
1Locker NumberAssignedStatus
21LiamAvailable
32AvailableAvailable
43ElijahAvailable
54AvailableAvailable
65BrokenBroken
76AvailableAvailable
87NoahAvailable
98AvailableAvailable
109AvailableAvailable
1110AvailableAvailable
1211AvailableAvailable
1312AvailableAvailable
1413AvailableAvailable
1514AvailableAvailable
1615AvailableAvailable
1716AvailableAvailable
1817OliviaAvailable
1918AvailableAvailable
2019AvailableAvailable
2120AvailableAvailable
LOCKERS
Cell Formulas
RangeFormula
B2:B21B2=IFERROR(IF(MATCH(LOCKERS!A2,'EMPLOYEE TRACKING'!M:M,0)=TRUE,"Open",IF(XLOOKUP(LOCKERS!A2,'EMPLOYEE TRACKING'!M:M,'EMPLOYEE TRACKING'!C:C)="",XLOOKUP(LOCKERS!A2,'EMPLOYEE TRACKING'!M:M,'EMPLOYEE TRACKING'!A:A),C2)),C2)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:C21Cell Value="Broken"textNO
B2:C21Cell Value="Available"textNO
Cells with Data Validation
CellAllowCriteria
C2:C21ListAvailable, Broken

----------------
Excel Data Validation Lockers.xlsx
ABCDEFGHIJKLM
1NameEnd DateLocker Number
2Liam1
3Noah7
4Oliver
5Elijah3
6James1/1/20223
7William
8Benjamin
9Lucas
10Henry
11Theodore
12Olivia17
13Emma
14Charlotte
15Amelia
16Ava
17Sophia
18Isabella
19Mia
20Evelyn
21Harper
EMPLOYEE TRACKING
Cells with Data Validation
CellAllowCriteria
M2List=IF($C$6="",'Available Lockers Hidden'!$A$2:$A$17,'Available Lockers Hidden'!$B$2)
M3:M21List='Available Lockers Hidden'!$A$2:$A$17

----------------
Excel Data Validation Lockers.xlsx
A
1Available Lockers
22
34
46
58
69
710
811
912
1013
1114
1215
1316
1418
1519
1620
17
18
19
20
21
22
Available Lockers Hidden
Cell Formulas
RangeFormula
A2:A22A2=IFERROR(INDEX(LOCKERS!$A$2:$A$21,SMALL(IF("Available"=LOCKERS!B2:B21,ROW(LOCKERS!B2:B21)-ROW(LOCKERS!B2)+1),ROW(LOCKERS!1:21))),"")
Dynamic array formulas.
 
Upvote 0
I am not sure I follow this at all. I tried and am coming up with all kinds of weird items and responses. When I copy and try to paste the first formula you have it opens up a window and is looking for a file name. At the top it says UPDATE VALUES:LOCKERS and is looking for a file name. I have no clue what to "point" it at.
 
Upvote 0
And on the lockers sheet it is copying over from column c to column b but even with the conditional formatting in it will not change the color in column b, but it does for column c
 
Upvote 0
Never mind the last comment. The color works. I just dont know where to point to when I try and paste the formula in column B
 
Upvote 0
So I duplicated what you did step by step as far as I can see and I cannot get anything to work properly. I am using Office 365 if that makes a difference. Every column has a formula in it, so I do not even know where to update the Locker numbers and names. Along with that, everytime I open up wither workbook, I get two errors. One is a security error that I have resolved. The next one is a reference error. I get a workbook contains links to one or more blah blah blah that could be unsafe....UPDATE...... DON'T UPDATE........CANCEL...... I guess I would choose UPDATE and when I do I get "We cant update some of the links in your workbook right now. You can continue without updating their values, or edit the links you think are wrong". CONTINUE.....EDIT LINKS...... Continue does nothing. Edit links opens up another box called an edit links box. It has a source, type, update and status column. The first row shows Source = Employee Tracking, TYPE = Worksheet, UPDATE = A, and STATUS = Error: Source not found. The next line is all the same except the SOURCE = Lockers. The choices I have are UPDATE VALUES, CHANGE SOURCE, OPEN SOURCE, BREAK LINK, CHECK STATUS or CLOSE. CLOSE does nothing and the others want me to change items.
 
Upvote 0
I think the problem is that everytime I go to paste a formula it opens an UPDATE VALUES prompt and I do not know what to choose.
 
Upvote 0
My suggestion is somewhat similar but see it could work for you.
Dedicate a column in the LOCKERS sheet to mark the broken lockers. I have used column D.
Enter the formulas shown in B2 and E2, no need to copy them down. (They will 'spill' down) You will need to check the ranges though.

rwe1187.xlsm
ABCDE
1Locker NumberAssigned/StatusShift NumBrokenOpen
21Employee 32
32Open6
43BrokenBroken12
54BrokenBroken15
65Employee 117
76Open
87Employee 4
98BrokenBroken
109BrokenBroken
1110Employee 6
1211Employee 9
1312Open
1413BrokenBroken
1514Employee 7
1615Open
1716BrokenBroken
1817Open
1918BrokenBroken
2019BrokenBroken
2120BrokenBroken
LOCKERS
Cell Formulas
RangeFormula
B2:B21B2=IF(D2:D21="",XLOOKUP(A2:A21,'EMPLOYEE TRACKING'!B$2:B$10,'EMPLOYEE TRACKING'!A$2:A$10,"Open"),D2:D21)
E2:E6E2=FILTER(A2:A21,B2:B21="Open","")
Dynamic array formulas.


Set up the EMPLOYEE TRACKING Data Validation like this.

rwe1187.xlsm
AB
1EmployeeLocker
2Employee 15
3Employee 2
4Employee 31
5Employee 47
6Employee 5
7Employee 610
8Employee 714
9Employee 8
10Employee 911
EMPLOYEE TRACKING
Cells with Data Validation
CellAllowCriteria
B2:B10List=LOCKERS!$E$2#


One thing to note with this is that you must use the drop-down to choose a locker for an employee, you cannot type it in.
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,025
Members
448,939
Latest member
Leon Leenders

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