data validation against two values and lookup

Lightkeepr

New Member
Joined
Apr 6, 2021
Messages
27
Office Version
  1. 365
Platform
  1. Windows
I have two tables, one for time entry and the other lists pay amounts.
Book1
ABCDEFGHIJ
2NameCodeClassRT HoursOT HoursDT Hours RT Pay OT Pay DT Pay Total
3Joe00120.0$ -
4Jane00210.0$ -
Time
Cell Formulas
RangeFormula
J3:J4J3=([@[RT Hours]]*[@[RT Pay]])+([@[OT Hours]]*[@[OT Pay]])+([@[DT Hours]]*[@[DT Pay]])
Cells with Data Validation
CellAllowCriteria
B3:B4List=codes


Book1
ABCDEFGH
3CODEClassificationRTOTDTUnique Codes List
4001Boss$ 10.00$ 15.00$ 20.00001
5002Asst Boss$ 9.00$ 13.50$ 18.00002
6002Manager$ 8.00$ 12.00$ 16.00003
7003Employee$ 7.00$ 10.50$ 14.00
8
Codes
Cell Formulas
RangeFormula
G4:G6G4=TEXT(UNIQUE(Table1[CODE],FALSE,FALSE),"000")
Dynamic array formulas.


On the first table I want to be able to enter a code in Code column that is data validated against the unique range in the second sheet (which currently works great). Where I am getting hung up is when it comes to the Class column on the first table. I want to have that be data validated against the codes table based on what code is in the previous cell.

So if Code 002 is used, in the Class column I only get 'Asst Boss' or 'Manager' as options to pick from.

Once both those values are picked, the rates for RT, OT and DT are used from the Codes table in the Time Table in their respective columns.

I thought about trying to use the filter function but couldn't get it to work in data validation rules and without building a bunch of other tables that would have to be manually tweaked if I added more to the Codes table, I am lost on what I am trying to do would be called to read up on it and learn how to solve this.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
One option if you are happy with helper cells.
+Fluff 1.xlsm
ABCDEFGHIJKL
1NameCodeClassRT HoursOT HoursDT Hours RT Pay OT Pay DT Pay Total
2Joe120Boss
3Jane210Asst BossManager
4
5
6
7
8CODEClassificationRTOTDTUnique Codes List
91Boss101520001
102Asst Boss913.518002
112Manager81216003
123Employee710.514
13
14
Lists
Cell Formulas
RangeFormula
K2,K3:L3K2=TRANSPOSE(FILTER($B$9:$B$12,$A$9:$A$12=B2))
G9:G11G9=TEXT(UNIQUE(A9:A12),"000")
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
B2:B3List=$G$9#
C2:C3List=K2#
 
Upvote 0
Thank you for the reply! I'm not entirely opposed to helpers but both sets of information being referred to or entered reside in tables and when I put the transpose-filter formula in off to the side of the time table, I get a #CALC! error 'Empty Arrays are not supported' and it wouldn't work too hot trying to incorporate it as a part of the table as some codes could have 5 classifications associated with it. Instead of direct Table references, I also tried named ranges for the same information and got the same error.



Book1.xlsx
ABCDEFGHIJKL
2NameCodeClassRT HoursOT HoursDT Hours RT Pay OT Pay DT Pay Total
3Joe001#CALC!20.0$ -#CALC!
4Jane002#CALC!10.0$ -#CALC!
5
Time
Cell Formulas
RangeFormula
C3:C4C3=L3#
J3:J4J3=([@[RT Hours]]*[@[RT Pay]])+([@[OT Hours]]*[@[OT Pay]])+([@[DT Hours]]*[@[DT Pay]])
L3:L4L3=TRANSPOSE(FILTER(Table1[Classification],Table1[CODE]=Table2[@Code]))
Cells with Data Validation
CellAllowCriteria
B3:B4List=codes
 
Upvote 0
Make sure that both sets of "Codes" are the same, it looks as though table1 Codes are just numbers formatted to show leading zeros.
Also the formula you have put in C3 & C4 should be in the data validation, not the cell.
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,139
Members
453,021
Latest member
Justyna P

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