Ok...so...
Formula in cell R5 was almost right. All it needed was the "Rates!" sheet reference added to the indirect function.
=SUMPRODUCT(D5:N5,INDIRECT("Rates!"&ADDRESS(MATCH(B5&$C$2,Rates!A:A,0),4)&":"&ADDRESS(MATCH(B5&$C$2,Rates!A:A,0),14)))
I then added an IFERROR function to prevent it from showing errors on empty lines.
=IFERROR(SUMPRODUCT(D5:N5,INDIRECT("Rates!"&ADDRESS(MATCH(B5&$C$2,Rates!A:A,0),4)&":"&ADDRESS(MATCH(B5&$C$2,Rates!A:A,0),14))),"")
I then replaced the $C$2 references with CELL("contents",INDIRECT(ADDRESS(ROW()-A5-2,3)))
This uses the crew number (assuming they always stay at numbers 1-10) to target the cell containing Day/Night/Weekend. Now you can copy the formula down the page without needing to change the $C$2 to $C$18 and $C$34 etc. It does it for you.
I also noticed that Shift Total in cell D17 can be =SUM(D16:N16) Instead of =D16+E16+F16+G16+H16+I16+J16+K16+L16+M16+N16
Final formula for cell R5:-
Bookmarks