Lookup & reference function

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])
ArgumentWhat it means
vectorRequiredA single row or column of values.
wrap_countRequiredHow many values go into each column before starting the next.
pad_withOptionalValue 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

C2fx=WRAPCOLS(A2:A8, 3, "")
ABCDE
1Attendee
2AnaAnaDevGita
3BenBenElif
4ChloeChloeFemi
5Dev
6Elif
7Femi
8Gita

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

C2fx=WRAPCOLS(A2:A8, 4, "")
ABCD
1Attendee
2AnaAnaElif
3BenBenFemi
4ChloeChloeGita
5DevDev
6Elif
7Femi
8Gita

With four per column the list fits in two columns; the last cell is empty text.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 14 KB

Common errors and how to fix them

ErrorWhy it happensFix
#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_column TRUE.

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.

LanguageFunction name
CzechZABALSLOUPCE
DanishFOLDKOLONNER
DutchOMLOOP.KOLOMMEN
FinnishRIVITÄSAR
FrenchORGA.COLS
GermanSPALTENUMBRUCH
HungarianOSZLOPTÖRDELÉS
ItalianA.CAPO.COL
Norwegian (Bokmål)BRYTKOL
PolishZAWIŃ.KOLUMNY
Portuguese (Brazil)QUEBRARCOLS
RussianСВЕРНСТОЛБЦ
SpanishAJUSTARCOLS
SwedishBRYTKOLUMN
TurkishSÜTUNSAR