I have a workbook with a master tab and then 52 tabs (one for each payroll week of the year with the pay date ending on Sunday). The sheets are named 2021 (1), 2021 (2), through 2021 (52). I have an INDEX MATCH formula that needs to look at the week ending date (Sunday) and then pull data from that week's tab so for example, this formula is running on the first tab, named 2021 (1),
=INDEX('2021 (1)'!$D$8:$AE$22,MATCH(Master!H2107,'2021 (1)'!$B$8:$B$22,0),MATCH(Master!G2107,'2021 (1)'!$D$5:$AF$5,0))
How can I alter this formula so I can drag and drop the abovementioned formula so it accounts for each tab change?
=INDEX('2021 (1)'!$D$8:$AE$22,MATCH(Master!H2107,'2021 (1)'!$B$8:$B$22,0),MATCH(Master!G2107,'2021 (1)'!$D$5:$AF$5,0))
How can I alter this formula so I can drag and drop the abovementioned formula so it accounts for each tab change?
Excel Report.xlsx | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
1 | Week Ending | Year | Week Number | Account | Dept Name | Type | Account # | Category | Amount | ||
2 | 01/03/21 | 2021 | 2 | Admin | Admin | Mgmt | 900700 | 001 - Straight Time | $ 1,955.00 | ||
3 | 01/10/21 | 2021 | 3 | SERVICES | Apartment Preparation Cleaners | Union | 900761 | 212 - Birthday | $ - | ||
4 | 01/17/21 | 2021 | 4 | UPGRADE | Garden - Repipe | Mgmt | 900732 | 300 - Allowances | $ - | ||
5 | 01/24/21 | 2021 | 5 | Floating Helpers | Floating Helpers | Union | 900606 | 200 - Bereavement | $ - | ||
6 | 01/31/21 | 2021 | 6 | Floating Helpers | Floating Helpers | Union | 900606 | 022 - Vacation | $ - | ||
Master |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C2:C6 | C2 | =WEEKNUM(A2,1) |
I2 | I2 | =INDEX('2021 (2)'!$D$8:$AE$22,MATCH(Master!H2,'2021 (2)'!$B$8:$B$22,0),MATCH(Master!G2,'2021 (2)'!$D$5:$AF$5,0)) |
I3 | I3 | =INDEX('2021 (3)'!$D$8:$AE$22,MATCH(Master!H3,'2021 (3)'!$B$8:$B$22,0),MATCH(Master!G3,'2021 (3)'!$D$5:$AF$5,0)) |
I4 | I4 | =INDEX('2021 (4)'!$D$8:$AE$22,MATCH(Master!H4,'2021 (4)'!$B$8:$B$22,0),MATCH(Master!G4,'2021 (4)'!$D$5:$AF$5,0)) |
I5 | I5 | =INDEX('2021 (5)'!$D$8:$AE$22,MATCH(Master!H5,'2021 (5)'!$B$8:$B$22,0),MATCH(Master!G5,'2021 (5)'!$D$5:$AF$5,0)) |
I6 | I6 | =INDEX('2021 (6)'!$D$8:$AE$22,MATCH(Master!H6,'2021 (6)'!$B$8:$B$22,0),MATCH(Master!G6,'2021 (6)'!$D$5:$AF$5,0)) |