удалите все и вставьте это в A2 ячейку:
=ARRAYFORMULA({SPLIT(TRANSPOSE(SPLIT(TEXTJOIN( , 1, "♠"&TEXT(
FILTER('Week of 18th March'!A3:A20, 'Week of 18th March'!B3:B20="Female"),
"m/d/yyyy")&"♦"&TEXT('Week of 18th March'!C1:M1, "h:mm am/pm")&"♦"&
QUERY('Week of 18th March'!A3:M20,
"select C,D,E,F,G,H,I,J,K,L,M where B='Female'", 0)), "♠")), "♦"),
INDEX(SPLIT(TRANSPOSE(SPLIT(TEXTJOIN( , 1, "♠"&TEXT(
FILTER('Week of 18th March'!A3:A20, 'Week of 18th March'!B3:B20="Male"),
"m/d/yyyy")&"♦"&TEXT('Week of 18th March'!C1:M1, "h:mm am/pm")&"♦"&
QUERY('Week of 18th March'!A3:M20,
"select C,D,E,F,G,H,I,J,K,L,M where B='Male'", 0)), "♠")), "♦"), , 3),
INDEX(SPLIT(TRANSPOSE(SPLIT(TEXTJOIN( , 1, "♠"&TEXT(
FILTER('Week of 18th March'!A3:A20, 'Week of 18th March'!B3:B20="Total"),
"m/d/yyyy")&"♦"&TEXT('Week of 18th March'!C1:M1, "h:mm am/pm")&"♦"&
QUERY('Week of 18th March'!A3:M20,
"select C,D,E,F,G,H,I,J,K,L,M where B='Total'", 0)), "♠")), "♦"), , 3)})