实在需求
将列转换为数组
数据情况
城市列
WRAPCOLS 函数
WRAPCOLS 函数允许我们将一列(一维数组)转换为二维数组。
该函数有三个参数:
Vector
要转换为数组的列
Wrap_count
数组每列的值的数量
[pad_with]
当该列中没有足够的条目时,我们希望用这个值来填充数组的最后一列。
Convert the column Cities into an Array with three entries per column.
=WRAPCOLS(A2:A13, 3)
The function will return an array with four columns and three rows.
上述函数将返回图2中的数组。
如果我们现在想要创建一个每列有五个条目的数组,那么最后一列将有三个空单元格。
Create an array with five entries per column from the cities column.
=WRAPCOLS(A2:A13, 5)
如果我们没有为 pad_with 指定值,则空单元格将用默认值 #N/A 填充&