WRAPROWS

The WRAPROWS function converts the provided row or column of values into a two-dimensional array by wrapping values into separate rows.

WRAPROWS(array, wrap-count, pad-with)

array: The array or reference to wrap.

wrap-count: The maximum number of values to include in each row of the returned array. Must be greater than or equal to 1.

pad-with: An optional value to use to fill empty cells in the returned array. The default is a formula error.

Notes

  • The elements of the array are placed in a two-dimensional array by row. Each row has wrap-count elements.

  • If there are not enough elements to fill the returned array, pad-with is used to pad the empty cells. By default, WRAPROWS returns an error for each cell that has no results.

  • If wrap-count is greater than or equal to the number of elements in array, then the array is returned in a single row.

  • WRAPROWS returns an error when array is not a one-dimensional array.

  • WRAPROWS returns an error when wrap-count is less than 1.

  • You can use the spilled range operator “#” to reference an array created by a formula.

Examples

Given the following table:

A

1

154

2

74

3

365

4

898

5

23

6

576

7

245

=WRAPROWS(A1:A7,4) wraps the column in range A1:A7 to an array of 4 columns. The missing element returns an error.

=WRAPROWS(A1:A7,4,“x”) wraps the column in range A1:A7 to an array of 4 columns. The missing element returns the pad character “x”.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.
Helpful?
Character limit: 250
Maximum character limit is 250.
Thanks for your feedback.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.