Hi,
Bit of a difficult one to explain, but I have a V-Lookup on a staff planning sheet that looks to see if a person has worked or hasn't work on a Saturday. If true it puts a tick, if false it puts a cross.
Currently this lookup looks like this:
=IF(VLOOKUP($B:$B,January!$B:$AH,6,FALSE)="08:30 - 14:30","ü",IF(VLOOKUP($B:$B,January!$B:$AH,6,FALSE)="08:30 - 15:00","ü",IF(VLOOKUP($B:$B,January!$B:$AH,6,FALSE)="09:00 - 15:00","ü","û")))
The different times are just the shift patterns people work on a Saturday - I'm aware this could be shortened but I have to be specific with this as I don't want it to count things like holiday or days off if the cell is filled with that.
This then proceeds across the month and across the year. I have different months on different sheets so the same v-lookup in February looks like this:
=IF(VLOOKUP($B:$B,February!$B:$AH,32,FALSE)="08:30 - 14:30","ü",IF(VLOOKUP($B:$B,February!$B:$AH,32,FALSE)="08:30 - 15:00","ü",IF(VLOOKUP($B:$B,February!$B:$AH,32,FALSE)="09:00 - 15:00","ü","û")))
and so on an so forth.
The issue I'm trying to solve is a way to automate updating the formula each year without having to manually do it as days move each year.
So for example, say the first Sat in Jan 2020 falls in col_index_num 6, on my sheet then next one would be column 13 (+7) etc etc. However in 2021 the first Saturday might fall in col_index_num 8, the next being 15....hopefully you get the idea!
At the moment every time I am doing a new year I have to manually go in and work out the column number for each Saturday, and change it...for all 52. There are some short cuts I make where I only really have to change the first row then I can drag the formula to the rest, but it's still 52 individual changes each year, and that's not counting that I have to do this 3 times per row as there are 3 different shifts!
What I'd like if it's possible is a way to rewrite the v-lookup so that once I've done the first it will add 7 to the next column, then 7 to that column - then I would only have to change 12. I know you can do +7 in a count formula but I'm unsure how to embed that into the column index on a v-lookup, but then I'm also unsure whether it would have to be +7, +14 +21 if it was only referencing the first row?
Hah! Hope some of that makes sense to someone!
Bookmarks