Wraps a provided row or column of values into columns by a specified count.
構文
WRAPCOLS(vector, wrap_count, [pad_with])引数
vector必須
The array or range to wrap.
wrap_count必須
The maximum number of values for each column.
pad_with省略可能
The value to use for padding if there are insufficient elements.
The WRAPCOLS function takes a single-dimensional array and reshapes it into a two-dimensional array by wrapping the elements into columns. If the total number of elements is not evenly divisible by the wrap_count, the remaining cells are filled with the optional pad_with value.
=WRAPCOLS({1,2,3,4,5}, 2)→{1,3,5; 2,4,#N/A}Wraps 5 elements into columns of 2, resulting in a 2x3 array with an error for the missing value.
Select the target cell
Click on the cell where you want the resulting array to begin.
Enter the formula
Type =WRAPCOLS followed by the range, the wrap count, and an optional padding value.
If the array cannot be perfectly divided, the function will return an #N/A error for the empty cells.