Nov 15 2023 07:51 PM
@Anna8atovarIf I've understood you correctly, you want to group your data by AppDate (column 1), then by FclId (column 6), with 3 blank rows inserted after each grouping. One possible way to do this is with a combination of dynamic array formulas as follows:
=LET(
data, A2:F6,
cols, CHOOSECOLS(data, 1, 6),
n, COLUMNS(cols),
k, TOROW(UNIQUE(cols)),
keys, WRAPROWS(TOROW(IF(SEQUENCE(3), k)), n),
arr, IFNA(VSTACK(HSTACK(cols, data), keys), ""),
DROP(SORT(arr, SEQUENCE(, n)),, n)
)
Note: adjust the data range "A2:F6" to include your entire data set.
This is a difficult one to explain, but basically what's happening is we've created "sort fields" consisting of the original data from the selected columns, plus a unique list of values from the selected columns repeated 3 times at the bottom. The sort fields are then added to the original data range, and the new rows are filled with empty text strings (""). The resulting array is sorted by the sort fields, which are then removed from the final results.
Additional Notes: