с помощью нескольких простых запросов вы можете сохранить четный порядок:
={Original!A1:F1; ARRAYFORMULA({ARRAY_CONSTRAIN(SORT(IF(ISERROR(VALUE(QUERY({
QUERY(TO_TEXT(Original!A2:D), "order by Col1", 0),
QUERY(TO_TEXT(Original!A2:E), "select Col5 order by Col1,Col5 desc", 0),
QUERY(TO_TEXT(Original!A2:F), "select Col6 order by Col1,Col6 desc", 0)},
"where Col5 is not null or Col6 is not null", 0))), (QUERY({
QUERY(TO_TEXT(Original!A2:D), "order by Col1", 0),
QUERY(TO_TEXT(Original!A2:E), "select Col5 order by Col1,Col5 desc", 0),
QUERY(TO_TEXT(Original!A2:F), "select Col6 order by Col1,Col6 desc", 0)},
"where Col5 is not null or Col6 is not null", 0)), IF(QUERY({
QUERY(TO_TEXT(Original!A2:D), "order by Col1", 0),
QUERY(TO_TEXT(Original!A2:E), "select Col5 order by Col1,Col5 desc", 0),
QUERY(TO_TEXT(Original!A2:F), "select Col6 order by Col1,Col6 desc", 0)},
"where Col5 is not null or Col6 is not null", 0)<>"", VALUE(QUERY({
QUERY(TO_TEXT(Original!A2:D), "order by Col1", 0),
QUERY(TO_TEXT(Original!A2:E), "select Col5 order by Col1,Col5 desc", 0),
QUERY(TO_TEXT(Original!A2:F), "select Col6 order by Col1,Col6 desc", 0)},
"where Col5 is not null or Col6 is not null", 0)), )), 1, 1), 999^99, 4),
QUERY(TO_TEXT(SORT(IF(ISERROR(VALUE(QUERY({
QUERY(TO_TEXT(Original!A2:D), "order by Col1", 0),
QUERY(TO_TEXT(Original!A2:E), "select Col5 order by Col1,Col5 desc", 0),
QUERY(TO_TEXT(Original!A2:F), "select Col6 order by Col1,Col6 desc", 0)},
"where Col5 is not null or Col6 is not null", 0))), (QUERY({
QUERY(TO_TEXT(Original!A2:D), "order by Col1", 0),
QUERY(TO_TEXT(Original!A2:E), "select Col5 order by Col1,Col5 desc", 0),
QUERY(TO_TEXT(Original!A2:F), "select Col6 order by Col1,Col6 desc", 0)},
"where Col5 is not null or Col6 is not null", 0)), IF(QUERY({
QUERY(TO_TEXT(Original!A2:D), "order by Col1", 0),
QUERY(TO_TEXT(Original!A2:E), "select Col5 order by Col1,Col5 desc", 0),
QUERY(TO_TEXT(Original!A2:F), "select Col6 order by Col1,Col6 desc", 0)},
"where Col5 is not null or Col6 is not null", 0)<>"", VALUE(QUERY({
QUERY(TO_TEXT(Original!A2:D), "order by Col1", 0),
QUERY(TO_TEXT(Original!A2:E), "select Col5 order by Col1,Col5 desc", 0),
QUERY(TO_TEXT(Original!A2:F), "select Col6 order by Col1,Col6 desc", 0)},
"where Col5 is not null or Col6 is not null", 0)), )), 1, 1, 5, 1)), "select Col5", 0),
QUERY(SORT(IF(ISERROR(VALUE(QUERY({
QUERY(TO_TEXT(Original!A2:D), "order by Col1", 0),
QUERY(TO_TEXT(Original!A2:E), "select Col5 order by Col1,Col5 desc", 0),
QUERY(TO_TEXT(Original!A2:F), "select Col6 order by Col1,Col6 desc", 0)},
"where Col5 is not null or Col6 is not null", 0))), (QUERY({
QUERY(TO_TEXT(Original!A2:D), "order by Col1", 0),
QUERY(TO_TEXT(Original!A2:E), "select Col5 order by Col1,Col5 desc", 0),
QUERY(TO_TEXT(Original!A2:F), "select Col6 order by Col1,Col6 desc", 0)},
"where Col5 is not null or Col6 is not null", 0)), IF(QUERY({
QUERY(TO_TEXT(Original!A2:D), "order by Col1", 0),
QUERY(TO_TEXT(Original!A2:E), "select Col5 order by Col1,Col5 desc", 0),
QUERY(TO_TEXT(Original!A2:F), "select Col6 order by Col1,Col6 desc", 0)},
"where Col5 is not null or Col6 is not null", 0)<>"", VALUE(QUERY({
QUERY(TO_TEXT(Original!A2:D), "order by Col1", 0),
QUERY(TO_TEXT(Original!A2:E), "select Col5 order by Col1,Col5 desc", 0),
QUERY(TO_TEXT(Original!A2:F), "select Col6 order by Col1,Col6 desc", 0)},
"where Col5 is not null or Col6 is not null", 0)), )), 1, 1), "select Col6", 0)})}