<< Go back to all functions

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 by wrap_count.

Step-by-Step Tutorial

  1. Wrapping a row into multiple columns:

    • Example: =WRAPCOLS(A1:G1, 3)
    • Result: {{"A1","B1","C1"},{"D1","E1","F1"},{"G1","",""}}
  2. Wrapping a column into multiple columns:

    • Example: =WRAPCOLS(A1:A6, 2)
    • Result: {{"A1","A2"},{"A3","A4"},{"A5","A6"}}
  3. Padding the last column with a specific value:

    • Example: =WRAPCOLS(A1:A7, 3, "")
    • Result: {{"A1","A2","A3"},{"A4","A5","A6"},{"A7","",""}}

Use Cases and Scenarios

  1. Data Organization: Arrange a long list of items into multiple columns for better readability.
  2. Data Analysis: Split a single column of data into multiple columns for further data manipulation.
  3. 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.

Related Articles