Forum Discussion

Zdenek_Moravec's avatar
Zdenek_Moravec
Brass Contributor
Aug 04, 2021
Solved

Divide list of volunteers into vaccination shifts

Imagine, that you get list of volunteers, which will help in your vaccination centre. The centre is opened on certain weekdays, morning or afternoon or both. Your task is to divide the volunteers in...
  • DKoontz's avatar
    DKoontz
    Aug 18, 2021

    Zdenek_Moravec 

    Totally forgot to plug that piece in! Made the filter a bit more complicated, but using this worked instead. Basically just looks at which day of the schedule it is, does an xlookup to find which column to filter by (by day), turns whichever cell the day (1-7) is in, into a column reference E:E, then filters that for "Yes".

     

    +TRANSPOSE(IF(Q5="Morning",FILTER(A:A,(B:B="yes")*(INDIRECT(SUBSTITUTE(ADDRESS(1,COLUMN(XLOOKUP(R5,$E$2:$K$2,$E$2:$K$2)),4),"1","")&":"&SUBSTITUTE(ADDRESS(1,COLUMN(XLOOKUP(R5,$E$2:$K$2,$E$2:$K$2)),4),"1",""))="Yes")),FILTER(A:A,(C:C="Yes")*(INDIRECT(SUBSTITUTE(ADDRESS(1,COLUMN(XLOOKUP(R5,$E$2:$K$2,$E$2:$K$2)),4),"1","")&":"&SUBSTITUTE(ADDRESS(1,COLUMN(XLOOKUP(R5,$E$2:$K$2,$E$2:$K$2)),4),"1",""))="Yes"))))

     

    Take a look now, runs a little slower but it works, I would only have the random numbers generate once when needed rather than on cell updates.

Resources