Assuming the data is in column B, the following two formulas do the job. In cell C1:
=filter(B1:B, row(B1:B) < 1 + max(filter(row(B:B), len(B:B))) / 2)
In cell D1:
=filter(B1:B, row(B1:B) >= 1 + max(filter(row(B:B), len(B:B))) / 2)
Explanation:
- Find the last row with data by
max(filter(row(B:B), len(B:B)))
- Divided by 2 and use as a threshold for splitting the column: rows above it go to column C, rows below it go to column D.
Older post, but I wrote a single-cell array formula that accomplishes this task and placed it into your editable sheet, in a new sheet I created for the purpose (Sheet2).
Headers are manually entered in Sheet2!A1:E1.
The following array formula is entered into Sheet2!A2:
=ArrayFormula(IF(ROW(Sheet1!A2:A)>COUNTA(Sheet1!A2:A)*18+1,"",{VLOOKUP(Sheet1!A$1,TRANSPOSE(QUERY({Sheet1!A:AM})),INT((ROW(Sheet1!A2:A)-2)/18)+2,FALSE),VLOOKUP(VLOOKUP(Sheet1!A$1,TRANSPOSE(QUERY({Sheet1!A:AM})),INT((ROW(Sheet1!A2:A)-2)/18)+2,FALSE),Sheet1!A2:AM,{2,3},FALSE),VLOOKUP(VLOOKUP(Sheet1!A$1,TRANSPOSE(QUERY({Sheet1!A:AM})),INT((ROW(Sheet1!A2:A)-2)/18)+2,FALSE),Sheet1!A2:AM,MOD(ROW(Sheet1!A2:A)-2,18)+4,FALSE),VLOOKUP(VLOOKUP(Sheet1!A$1,TRANSPOSE(QUERY({Sheet1!A:AM})),INT((ROW(Sheet1!A2:A)-2)/18)+2,FALSE),Sheet1!A2:AM,MOD(ROW(Sheet1!A2:A)-2,18)+22,FALSE)}))
Best Answer
You can address your issue by using 2 similar formulas as shown in the tab I have created in your spreadsheet.
The most challenging of the two is in cell
P4
where we calculate the timesIn cell
N3
we place the following formula that is replicated by pulling to the right for cellsO4
,Q4
,R4
,S4
,T4
,U4
,V4
,W4
,X4
,Y4
.If interested on how the formulas work, do let me know.
Functions used:
QUERY
INDEX
IFERROR
REGEXREPLACE
FLATTEN
SPLIT
CHAR