WRAPCOLS

WRAPCOLS(vector, wrap_count [,pad_with])

Returns the array transformed into multiple columns.

vectorThe vector or reference to wrap
Must be a single row or column.
wrap_countThe maximum number of values in each column.
pad_with(Optional) The value with which to pad.

REMARKS
* This function was added in Microsoft 365.
* This function can create a Dynamic Array Formula.
* The elements of the vector are placed into a 2-dimensional array by column and each column has "wrap_count" elements.
* The column is padded with "pad_with" if there are insufficient elements to fill it.
* If "vector" is not a 1-dimensional array, then #VALUE! is returned. Example 8.
* If "wrap_count" is greater or equal to the number of elements in vector, then the vector is simply returned as the result of the function.
* If "pad_with" is left blank, then #N/A is used.
* You can use the TOCOL function to return the array transformed into a single column.
* You can use the TOROW function to return the array transformed into a single row.
* You can use the WRAPROWS function to return the array transformed into multiple rows.
* This function was first released in March 2022.
* For the Microsoft documentation refer to support.microsoft.com

 ABCDEFGH
1=WRAPCOLS(C1:H1,2) = {"A","C","E" ; "B","D","F"} ABCDEF
2=WRAPCOLS(C1:F1,2) = {"A","C" ; "B","D"} B     
3=WRAPCOLS(C1:D1,2) = {"A" ; "B"} C     
4=WRAPCOLS(C1:D1,1) = {"A","B"} D     
5=WRAPCOLS(C1:F1,4) = {"A" ; "B" ; "C" ; "D"}       
6=WRAPCOLS(C1:C4,2) = {"A","C" ; "B","D"}       
7=WRAPCOLS(C1:C4,1) = {"A","B","C","D"}       
8=WRAPCOLS(C1:D2,1) = #VALUE!       

1 - What is the range (or row-vector) "C1:H1" converted to a 2-dimensional array with 2 rows. This has 3 columns.
2 - What is the range (or row-vector) "C1:F1" converted to a 2-dimensional array with 2 rows. This has 2 columns.
3 - What is the range (or row-vector) "C1:D1" converted to a 2-dimensional array with 2 rows. This has 1 column.
4 - What is the range (or row-vector) "C1:D1" converted to a 2-dimensional array with 1 row. This has 2 columns.
5 - What is the range (or row-vector) "C1:F1" converted to a 2-dimensional array with 4 rows. This has 1 column.
6 - What is the range (or column-vector) "C1:C4" converted to a 2-dimensional array with 2 rows. This has 2 columns.
7 - What is the range (or column-vector) "C1:C4" converted to a 2-dimensional array with 4 rows. This has 1 column and has transformed the column into a row.
8 - What is the range "C1:D2" converted to a 2-dimensional array with 1 row. The "vector" is not a single row or column.

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top