WRAPCOLS function
Wraps a single row or column of values into a grid, filling down each column and starting a new column after a set number of values.
Available in Microsoft 365, Excel 2024, Excel for the web, Excel for Mac 2024+
Excel 2024 and laterWorks in Google Sheets
Syntax
WRAPCOLS(vector, wrap_count, [pad_with])| Argument | What it means | |
|---|---|---|
vector | Required | A single row or column of values. |
wrap_count | Required | How many values go into each column before starting the next. |
pad_with | Optional | Value for leftover cells in the last column. Without it they show #N/A. |
Returns: A grid with wrap_count rows, filled column by column, which spills.
How WRAPCOLS works
WRAPCOLS breaks a long list into columns of equal height - the newspaper-column layout. It is useful when a long list would scroll off a printed page: wrap 60 product codes into columns of 20 and they fit side by side.
Items are placed down the first column until it holds wrap_count values, then the next column starts. Gaps in the last column show #N/A unless pad_with is supplied. The input must be one row or one column. WRAPROWS fills across rows instead.
Examples
1Attendees in columns of three
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Attendee | ||||
| 2 | Ana | Ana | Dev | Gita | |
| 3 | Ben | Ben | Elif | ||
| 4 | Chloe | Chloe | Femi | ||
| 5 | Dev | ||||
| 6 | Elif | ||||
| 7 | Femi | ||||
| 8 | Gita |
The first three names go down the first column, the next three down the second, and Gita starts a third column.
2Two columns for printing
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Attendee | |||
| 2 | Ana | Ana | Elif | |
| 3 | Ben | Ben | Femi | |
| 4 | Chloe | Chloe | Gita | |
| 5 | Dev | Dev | ||
| 6 | Elif | |||
| 7 | Femi | |||
| 8 | Gita |
With four per column the list fits in two columns; the last cell is empty text.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#VALUE! | vector is a grid instead of a single row or column. | Flatten it with TOCOL first. |
#NUM! | wrap_count is less than 1. | Use 1 or more. |
Tips
- Work out the column height for a fixed number of columns:
=WRAPCOLS(A2:A61, ROUNDUP(ROWS(A2:A61)/3, 0), "")gives three columns. - The reverse operation is TOCOL with
scan_by_columnTRUE.
Google Sheets
WRAPCOLS also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
WRAPCOLS in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Czech | ZABALSLOUPCE |
| Danish | FOLDKOLONNER |
| Dutch | OMLOOP.KOLOMMEN |
| Finnish | RIVITÄSAR |
| French | ORGA.COLS |
| German | SPALTENUMBRUCH |
| Hungarian | OSZLOPTÖRDELÉS |
| Italian | A.CAPO.COL |
| Norwegian (Bokmål) | BRYTKOL |
| Polish | ZAWIŃ.KOLUMNY |
| Portuguese (Brazil) | QUEBRARCOLS |
| Russian | СВЕРНСТОЛБЦ |
| Spanish | AJUSTARCOLS |
| Swedish | BRYTKOLUMN |
| Turkish | SÜTUNSAR |