INDEX / MATCH Used Horizontally & Looking for a Value Based on a Dropdown List

LucieLiskova

New Member
Joined
Jan 19, 2017
Messages
17
Hi All,

Second question this week, apologies. I have the below issue.

I have two Excel sheets Construction Payroll Hrs 2023 & Payroll File 2023. In Payroll File 2023, I need the Breakdown section (OT 1.5, OT 2, Holidays, Bank Holidays, Sick Paid, Sick Unpaid) to be filled out based on the week number in B5. This information will be taking from the Construction Payroll Hrs 2023. So number of let's say overtime 1.5 hours will match the Employee ID as well as the specific week i.e. in week 18, employee ID 1 will have the following hrs: 4.5 in OT 1.5, 10 in OT 2, 8 in bank holiday etc. These numbers will change depending on the week. I hope it makes sense.

Thank you.
Lucie.

Construction Payroll Hrs 2023.xlsx
CDELMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAM
4PERIOD 10 wk18
5Week 18
6MonTueWedThuFriSatSunWEEK 18
701/05/202302/05/202303/05/202304/05/202305/05/202306/05/202307/05/2023
8Employee IDFirst NameSurnameShiftO/TShiftO/TShiftO/TShiftO/TShiftO/TFirst 4 hrsO/TO/TAnnual Leave TotalBank Holiday (10 days/year)Sick Leave (3 days / 12-month period)Sick Leave (day count)Sick helpr formulaAnnual Leave - half day Annual Leave - full dayParental Leave (unpaid)Total Hrs Excl Sick and double OTBASICOT 1.5 OT 1.5 HELPEROT 2OT 2 HELPERTOTAL
91BH2SL181817.515230.008.008.001.008.000.000.000.0042.5031.504.5011.0010.005.0054.00
102BH8887.50.008.000.000.000.000.000.000.0039.5039.500.000.000.000.0039.50
113BH48887.50.008.000.000.000.000.000.000.0043.5039.506.004.000.000.0045.50
124BH58887.50.008.000.000.000.000.000.000.0044.5039.507.505.000.000.0047.00
135BH8887.50.008.000.000.000.000.000.000.0039.5039.500.000.000.000.0039.50
146BH8887.50.008.000.000.000.000.000.000.0039.5039.500.000.000.000.0039.50
157BH8887.50.008.000.000.000.000.000.000.0039.5039.500.000.000.000.0039.50
168BH8887.50.008.000.000.000.000.000.000.0039.5039.500.000.000.000.0039.50
179BH8887.50.008.000.000.000.000.000.000.0039.5039.500.000.000.000.0039.50
1810BH8887.50.008.000.000.000.000.000.000.0039.5039.500.000.000.000.0039.50
1911BH8887.50.008.000.000.000.000.000.000.0039.5039.500.000.000.000.0039.50
2012BH8887.50.008.000.000.000.000.000.000.0039.5039.500.000.000.000.0039.50
2113BH8887.50.008.000.000.000.000.000.000.0039.5039.500.000.000.000.0039.50
2214BH8887.50.008.000.000.000.000.000.000.0039.5039.500.000.000.000.0039.50
2315BH8887.50.008.000.000.000.000.000.000.0039.5039.500.000.000.000.0039.50
2416BH8887.50.008.000.000.000.000.000.000.0039.5039.500.000.000.000.0039.50
2517BH8887.50.008.000.000.000.000.000.000.0039.5039.500.000.000.000.0039.50
2618BH8887.50.008.000.000.000.000.000.000.0039.5039.500.000.000.000.0039.50
2719BH8887.50.008.000.000.000.000.000.000.0039.5039.500.000.000.000.0039.50
2820BH8887.50.008.000.000.000.000.000.000.0039.5039.500.000.000.000.0039.50
Construction - Payroll Hrs 2023
Cell Formulas
RangeFormula
Y9:Y28Y9=SUM(AD9:AE9)
Z9:Z28Z9=COUNTIF(L9:X9,"BH")*8
AA9:AA28AA9=IF(AB9<3,AB9*8,"")
AB9:AB28AB9=COUNTIF(L9:X9,"SL")
AC9:AC28AC9=COUNTIF(L9:X9,"SL")*8
AD9:AD28AD9=COUNTIF(L9:X9,"AL.5")*4
AE9:AE28AE9=COUNTIF(L9:X9,"AL")*8
AF9:AF28AF9=COUNTIF(L9:X9,"PL")*0
AG9:AG28AG9=SUM(L9:V9)+Y9+Z9
AH9:AH28AH9=SUM(L9,N9,P9,R9,T9,Y9,Z9)
AI9:AI28AI9=IF(AH9>39.5,(AH9+AJ9)*1.5,(AG9-39.5)*1.5)
AJ9:AJ28AJ9=SUM(M9,O9,Q9,S9,U9,V9)
AK9:AK28AK9=IF(AH9+AJ9>39.5,(W9+X9)*2,(W9+X9))
AL9:AL28AL9=SUM(W9:X9)
AM9:AM28AM9=IF(AH9>=39.5,AH9+AI9+AK9+AC9,(AH9+AC9+AI9+AK9))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
R9:R28Cell Valuecontains "BH"textNO
R9:R28Cell Valuecontains "PL"textNO
R9:R28Cell Valuecontains "SL"textNO
R9:R28Cell Valuecontains "AL"textNO
P9:P28Cell Valuecontains "BH"textNO
P9:P28Cell Valuecontains "PL"textNO
P9:P28Cell Valuecontains "SL"textNO
P9:P28Cell Valuecontains "AL"textNO
V9:X28Cell Valuecontains "BH"textNO
V9:X28Cell Valuecontains "PL"textNO
V9:X28Cell Valuecontains "SL"textNO
V9:X28Cell Valuecontains "AL"textNO
T9:T28Cell Valuecontains "BH"textNO
T9:T28Cell Valuecontains "PL"textNO
T9:T28Cell Valuecontains "SL"textNO
T9:T28Cell Valuecontains "AL"textNO
N9:N28Cell Valuecontains "BH"textNO
N9:N28Cell Valuecontains "PL"textNO
N9:N28Cell Valuecontains "SL"textNO
N9:N28Cell Valuecontains "AL"textNO
L9:L28Cell Valuecontains "BH"textNO
L9:L28Cell Valuecontains "PL"textNO
L9:L28Cell Valuecontains "SL"textNO
L9:L28Cell Valuecontains "AL"textNO



Payroll File 2023..xlsx
ABCFGHIJKL
3CONSTRUCTION PAYROLL
4PERIODPERIOD 10 wk18
5WEEKWeek 18
6
7Employee IDTotal HoursBreakdown
8OT 1.5OT 2HolidaysBank HolidaysSick PaidSick Unpaid
9154.000
10239.50
11345.50
12447.00
13539.50
14639.50
15739.50
16839.50
17939.50
181039.50
191139.50
201239.50
211339.50
221439.50
231539.50
241639.50
251739.50
261839.50
271939.50
Payroll File 2023
Cell Formulas
RangeFormula
B5B5=HLOOKUP(B$4,'C:\Users\lucie.liskova\Desktop\[Construction Payroll Hrs 2023 - Copy.xlsx]Construction - Payroll Hrs 2023'!$K$4:$FZ$28,2,FALSE)
F9F9=INDEX('C:\Users\lucie.liskova\Desktop\[Construction Payroll Hrs 2023 - Copy.xlsx]Construction - Payroll Hrs 2023'!$AI$9:$BK$9,MATCH(B5,'C:\Users\lucie.liskova\Desktop\[Construction Payroll Hrs 2023 - Copy.xlsx]Construction - Payroll Hrs 2023'!$AI$8:$BK$8))
C9:C10C9=INDEX('[Construction Payroll Hrs 2023-Copy]Construction - Payroll Hrs 2023'!$C$6:$AMJ$28,MATCH($B9,'[Construction Payroll Hrs 2023-Copy]Construction - Payroll Hrs 2023'!$C$6:$C$28,0),MATCH($B$5,'[Construction Payroll Hrs 2023-Copy]Construction - Payroll Hrs 2023'!$C$6:$AMJ$6,0))
C11:C27C11=INDEX('[Construction Payroll Hrs 2023-Copy]Construction - Payroll Hrs 2023'!$C$6:$AMJ$28,MATCH($B11,'[Construction Payroll Hrs 2023-Copy]Construction - Payroll Hrs 2023'!$C$6:$C$28,0),MATCH($B$5,'[Construction Payroll Hrs 2023-Copy]Construction - Payroll Hrs 2023'!$C$6:$AMJ$6,0))
Press CTRL+SHIFT+ENTER to enter array formulas.
Named Ranges
NameRefers ToCells
'Payroll File 2023'!_FilterDatabase='Payroll File 2023'!$B$4:$B$4B5
Cells with Data Validation
CellAllowCriteria
B4List=$AC$3:$AC$4
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi All,

I tried this one: =VLOOKUP(B9,'[Construction Payroll Hrs 2023.xlsx]Construction - Payroll Hrs 2023'!$C$9:$CQ$28,33,MATCH(B5,'[Construction Payroll Hrs 2023.xlsx]Construction - Payroll Hrs 2023'!$L$5:$CQ$5,0)). However, it only works for the first value it needs to find, doesn't change afterwards.

Any ideas, please?

Thank you.


L.
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,081
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