I have several questions about sorting and organizing a schedule in google sheets. I have found some work arounds to get most of what I want done but was hoping to get some input and maybe some ideas on ways to make it work better.
Problem - I have a CSV file I can generate for the work schedule of all the employees. It is not very coinvent to work with and look at. I am trying to take the data from the spreadsheet and sort it by day, department and Name.
Ideally this would be done with a dynamic filter/pivot table/dynamic array that way there's not a lot of code in each cell and would automatically fill and sort.
I can also provide all my work around code if needed.
Sheet Example
"Full Week" sheet is what I am starting with and "Sorted by Day" sheet is the output/end goal I am looking for.
Hopefully this is enough information and sorry if this is the wrong place to ask/ post this.
Thank you for the help. I am still having a bit of trouble implementing it into my final schedule sheet. Here is the my final sheet with all of my workaround code.
try:
=INDEX(IFERROR(REGEXREPLACE(TRANSPOSE(SPLIT(TRIM(FLATTEN(QUERY(QUERY(SUBSTITUTE(
TRIM(SPLIT(FLATTEN(QUERY(TRANSPOSE(REGEXREPLACE(REGEXREPLACE(TRIM(QUERY(SPLIT(FLATTEN(
QUERY(TRANSPOSE(QUERY(SPLIT(FLATTEN(IF('Full Week'!B2:20="",,'Full Week'!B1:1&"♣"&
TEXT('Full Week'!B1:1, "emmdd\♠ddd\♦")&"♣"®EXREPLACE(VLOOKUP(ROW('Full Week'!A2:A20),
IF('Full Week'!A2:A20<>"", {ROW('Full Week'!A2:A20), 'Full Week'!A2:A20}), 2, 1),
"(.*),(.*)", "♥$2 $1")&"♣♥"&SUBSTITUTE('Full Week'!B2:20, CHAR(10), "♣"))), "♣"),
"select Col2,Col5,Col3,Col4
where not Col4 matches '^♥ $'
and Col1 >= date '"&TEXT(TODAY()+1, "e-m-d")&"'
and Col1 <= date '"&TEXT(TODAY()+4, "e-m-d")&"'")),,9^9)), "♦"),
"select max(Col2)
group by Col2
pivot Col1")), "^♥", "♂ ♥"), "^$", " ♥ ♥ ♥")&" ♥"),,9^9)), "♥")), " ", "♀"),
"offset 1", 0),,9^9))), " ")), "♀|♂", " ")))