Answer the question
In order to leave comments, you need to log in
How to add new Cols to the QUERY function?
Hello. I am transferring a table from to another sheet with formatting. More on this in my previous question. How to split cell data separated by commas and transfer to another sheet? How to automate this?
My original table:
Answer the question
In order to leave comments, you need to log in
P is the column over the horizon, that is, the letter that the rightmost column will have if one more is added. Your last one is O. So the next one is P.
=QUERY(
ARRAYFORMULA(
{
QUERY(
FLATTEN(IFERROR(SPLIT('Данные'!B:B, ", ", 0))),
"WHERE Col1 IS NOT NULL",
0
),
VLOOKUP(
QUERY(
FLATTEN(IF(IFERROR(SPLIT('Данные'!B:B, ", ", 0)) = "",, ROW('Данные'!A:A))),
"WHERE Col1 IS NOT NULL",
0
),
{
ROW('Данные'!A:A),
'Данные'!A:A,
'Данные'!C:P
},
SEQUENCE(1, COLUMNS('Данные'!C:P) + 1, 2),
0
)
}
),
"SELECT Col2, Col1, Col" & JOIN(", Col", SEQUENCE(1, COLUMNS('Данные'!C:P), 3)) & "
FORMAT Col2 'yyyy-mm-dd hh:mm:ss'",
1
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question