google sheets – Arrayformula to run a separate column MAX

= ARRAYFORMULA (QUERY (TRANSPOSE) (QUERY (TRANSPOSE) (
{QUERY (QUERY (TRANSPOSE) (QUERY (TRANSPOSE ({
QUESTION (A2: A, "limit" and COUNTA (A2: A)),
QUERY (OFFSET (A2: A, -1, 0), "limit" and COUNTA (A2: A) -1)}),
"select" & REGEXREPLACE (UNIR (, IF (LEN (A2: A),
"max (Col" & ROW (A2: A) -ROW (A2) + 1 & "),",)), ".  z", "") & "")),
"select Col2"),
"limit" and COUNTA (A2: A)),
{""; QUERY (TRANSPONER) (QUERY (TRANSPONER ({
QUESTION (A2: A, "limit" and COUNTA (A2: A)),
QUERY (OFFSET (A2: A, -1, 0), "limit" and COUNTA (A2: A) -1)}),
"select" & REGEXREPLACE (UNIR (, IF (LEN (A2: A),
"max (Col" & ROW (A2: A) -ROW (A2) + 1 & "),",)), ".  z", "") & "")),
"select Col2
limit "& COUNTA (A2: A) -1)}}),
"select" & REGEXREPLACE (UNIR (, IF (LEN (A2: A),
"max (Col" & ROW (A2: A) -ROW (A2) + 1 & "),",)), ".  z", "") & "")),
"select Col2"))

0

demo spreadsheet