WRAPCOLS
The WRAPCOLS
function in Google Sheets allows you to wrap a provided row or column of cells by columns after a specified number of elements, forming a new array. This function can be useful when you need to reorganize data into multiple columns.
Function Syntax and Parameters
Syntax: WRAPCOLS(range, wrap_count, [pad_with])
Parameters:
range
: The range of cells to wrap.wrap_count
: The number of elements per column in the new array.pad_with
(optional): The value to use when padding the last column if the number of elements is not evenly divisible bywrap_count
.
Step-by-Step Tutorial
-
Wrapping a row into multiple columns:
- Example:
=WRAPCOLS(A1:G1, 3)
- Result:
{{"A1","B1","C1"},{"D1","E1","F1"},{"G1","",""}}
- Example:
-
Wrapping a column into multiple columns:
- Example:
=WRAPCOLS(A1:A6, 2)
- Result:
{{"A1","A2"},{"A3","A4"},{"A5","A6"}}
- Example:
-
Padding the last column with a specific value:
- Example:
=WRAPCOLS(A1:A7, 3, "")
- Result:
{{"A1","A2","A3"},{"A4","A5","A6"},{"A7","",""}}
- Example:
Use Cases and Scenarios
- Data Organization: Arrange a long list of items into multiple columns for better readability.
- Data Analysis: Split a single column of data into multiple columns for further data manipulation.
- Formatting: Structure data for printing or presentation purposes.
Related Functions
TRANSPOSE
: Convert rows into columns and columns into rows in a range or array.SPLIT
: Split text into multiple columns based on a delimiter.