Excel WRAPROWS Function: Reshape Long Lists into Report-Ready Grids
The WRAPROWS function transforms one-dimensional arrays – long vertical columns or horizontal rows – into clean two-dimensional grids. Whether you’re creating product catalogs, building multi-column reports, or formatting import data, WRAPROWS reshapes linear lists into professional layouts with a single formula.
Table of Contents
What Does the WRAPROWS Function Do?
WRAPROWS takes a single-dimension array (a list) and reshapes it into a two-dimensional structure by wrapping values across rows at a specified count. Instead of manually organizing data or creating complex helper formulas, WRAPROWS automatically distributes your list into a grid format where each row contains exactly the number of items you specify.
This function is particularly valuable for transforming imported data, creating catalog layouts, displaying results in compact grids for dashboards, and preparing data for printing in multi-column formats. The beauty of WRAPROWS lies in its simplicity one formula replaces what would otherwise require tedious manual arrangement or array manipulation.
WRAPROWS Syntax and Arguments
=WRAPROWS(vector, wrap_count, [pad_with])
- vector (required): The one-dimensional array or range to reshape. This can be a vertical column (like A2:A100) or horizontal row (like B2:K2). WRAPROWS works with either orientation.
- wrap_count (required): The maximum number of values to display in each output row. Once this count is reached, WRAPROWS automatically starts a new row.
- pad_with (optional): The value used to fill empty cells in the last row if the data count is not a perfect multiple of the wrap count. If omitted, Excel defaults to filling with
#N/Aerrors.
Key Rules:
- Vector must be one-dimensional (either 1xN or Nx1 layout).
- Wrap_count must be greater than or equal to 1.
- Data flows left-to-right within each row, then continues on the next row.
- The resulting array spills automatically; ensure adequate empty space to the right and below.
Key Behaviors and Important Notes
- Spill behavior: WRAPROWS is a dynamic array function that automatically spills across multiple cells. If cells are occupied, you get
#SPILL!error. - Row-wise wrapping: Values flow from left to right along each row. Once wrap_count is reached, a new row begins at the left.
- #N/A padding: When data doesn’t perfectly fill the last row, empty cells default to
#N/Aunless you specify a custom pad_with value. - Single dimension required: If your input is two-dimensional, WRAPROWS returns
#VALUE!error. Use TOCOL or TOROW first to flatten. - Invalid wrap count: If wrap_count is less than 1, Excel returns
#NUM!error. - Output dimensions: Total rows = CEILING(array_length / wrap_count); Total columns = wrap_count or fewer in the last row.
- Live updates: If your source array grows or shrinks, WRAPROWS automatically adjusts the grid dimensions.
Basic Examples
Example 1: Simple list to grid conversion
You have a vertical list of 12 product names in A2:A13:
| Apple | Banana | Cherry | Date |
| Elderberry | Fig | Grape | Honeydew |
| Kiwi | Lemon | Mango | Nectarine |
Formula (in cell C2):
=WRAPROWS(A2:A13, 4)
Result: A 3×4 grid with 4 products per row, 3 rows total.
Example 2: Wrapping with custom padding
You have 11 items but want 4 per row (11 ÷ 4 = 2 rows with 3 items in the last row):
=WRAPROWS(A2:A12, 4, "-")
Result: The last row displays 3 items followed by one dash in the 4th column.
Example 3: Horizontal to multi-row conversion
Source data is horizontal in B2:J2 (8 values):
=WRAPROWS(B2:J2, 3)
Result: A 3×3 grid with values arranged left-to-right, top-to-bottom. The last cell shows #N/A.
Example 4: Replacing #N/A with blank cells
To make output cleaner for reports:
=WRAPROWS(A2:A12, 4, "")
Empty padding cells display as blank instead of error values.
Example 5: Dynamic wrapping with sorted data
=WRAPROWS(SORT(A2:A20), 5)
Sorts the list alphabetically first, then wraps into rows of 5 items each.
Creating Report-Ready Layouts
Product Catalog Grid
Convert a long inventory list into a printable multi-column catalog:
=VSTACK(
{"Product Catalog"},
WRAPROWS(FILTER(Inventory!A:A, Inventory!A:A <> ""), 6, "")
)
Creates a title row followed by the product list wrapped into 6 columns per row. Perfect for printing on standard paper.
Multi-Column Report from Import
When data imports as a single column but should display in multiple columns:
=WRAPROWS(
FILTER(ImportData!A:A, ImportData!A:A <> ""),
8,
""
)
Instantly reorganizes imported names or items into an 8-column layout.
Dashboard Tile Layout
Display metric values in a grid pattern for dashboard views:
=WRAPROWS(
HSTACK(Metrics_Names, Metrics_Values),
4,
""
)
Combines names and values horizontally, then wraps them into rows of 4 tiles each.
Matrix with Headers
Add column headers to wrapped data:
=VSTACK(
{"Column 1", "Column 2", "Column 3", "Column 4"},
WRAPROWS(A1:A50, 4, "")
)
Creates a professional table with headers and wrapped data below.
Advanced Function Combinations
WRAPROWS + TOCOL for multi-source reshaping
=WRAPROWS(
TOCOL(HSTACK(Column_A, Column_B, Column_C)),
5,
""
)
Combines three columns horizontally, flattens to a single column with TOCOL, then wraps into rows of 5.
WRAPROWS + UNIQUE for deduplication and layout
=WRAPROWS(
UNIQUE(FILTER(A:A, A:A <> "")),
4,
""
)
Removes duplicates and blanks from the source, then wraps unique values into a 4-column grid.
WRAPROWS + SORT + FILTER
=WRAPROWS(
SORT(FILTER(Products!A:A, Products!B:B > 100), 1, 1),
6,
""
)
Filters products by quantity, sorts alphabetically, then displays in a 6-column catalog layout.
WRAPROWS + SEQUENCE for number grids
=WRAPROWS(
SEQUENCE(20),
5,
""
)
Generates numbers 1-20 and arranges them in a 5-column grid (4 rows × 5 columns).
Nested WRAPROWS with multiple transformations
=WRAPROWS(
SORT(
UNIQUE(
FILTER(Master_List!A:A, Master_List!A:A <> "")
)
),
8,
""
)
Filters blanks, removes duplicates, sorts alphabetically, then wraps into an 8-column report grid.
Real-World Applications
E-commerce Product Display
Display inventory in a customer-facing grid format:
=WRAPROWS(
FILTER(Inventory[Product Name], Inventory[In Stock] = TRUE),
4,
""
)
Shows only in-stock products in a neat 4-column grid suitable for web or print catalogs.
Meeting Attendance Roster
Convert vertical attendee list to compact grid for sign-in sheets:
=WRAPROWS(
SORT(Attendees!A:A),
5,
""
)
Sorts names alphabetically and displays 5 per row, reducing paper usage for printed rosters.
Bulk Data Import Processing
When external systems deliver data as a single column:
=WRAPROWS(
FILTER(Raw_Import!A:A, Raw_Import!A:A <> ""),
10,
""
)
Automatically reformats imported records into a 10-column layout for analysis.
Survey Response Dashboard
Display survey options in a voting grid:
=WRAPROWS(
Survey_Options,
6,
""
)
Shows 6 survey choices per row, making visual scanning and selection intuitive.
Training Class Seating Chart
Arrange students into classroom rows:
=WRAPROWS(
SORT(Class_Roster),
8,
""
)
Creates an 8-seat-per-row seating arrangement from a vertical student list.
WRAPROWS vs. WRAPCOLS
While WRAPROWS wraps data horizontally (left to right), WRAPCOLS wraps data vertically (top to bottom):
| Aspect | WRAPROWS | WRAPCOLS |
|---|---|---|
| Flow Direction | Left-to-right horizontally, then new row | Top-to-bottom vertically, then new column |
| Count Argument | Values per row (column count) | Values per column (row count) |
| Use Case | Create multi-column catalogs, horizontally-oriented reports | Create multi-row matrices, vertically-oriented grids |
| Example | =WRAPROWS(A1:A20, 5) → 4 rows × 5 columns | =WRAPCOLS(A1:A20, 4) → 4 rows × 5 columns |
Handling Edge Cases and Challenges
Issue: Perfect fit divides unevenly
When array length doesn’t divide evenly by wrap_count, the last row is incomplete.
Example: 17 items with wrap_count of 5 creates rows: [5, 5, 5, 2] with 3 #N/A values in the last row.
Solution: Specify pad_with to fill cleanly.
=WRAPROWS(A1:A17, 5, "-")
Issue: #SPILL! error blocking output
If cells to the right or below are occupied, WRAPROWS cannot spill.
Solution: Move the formula to an area with enough empty space, or clear the blocked cells.
Issue: Data with blanks or inconsistent lengths
Blank cells within the source data create spacing issues in the output.
Solution: Clean the data first with FILTER.
=WRAPROWS(
FILTER(A:A, A:A <> ""),
5,
""
)
Issue: Two-dimensional input causes error
WRAPROWS requires a one-dimensional array. Multi-column input triggers #VALUE!.
Solution: Use TOCOL to flatten first.
=WRAPROWS(
TOCOL(Range_2D),
4,
""
)
Issue: Preserving data types and formatting
Wrapping text and numbers together can cause alignment issues.
Solution: Convert to text explicitly if needed.
=WRAPROWS(
TEXT(A1:A20, "0"),
5,
""
)
Common Mistakes and How to Avoid Them
Mistake 1: Forgetting to exclude headers
Including header rows in the source creates misaligned output.
Wrong: =WRAPROWS(A1:A20, 5) (includes header in A1)
Correct: =WRAPROWS(A2:A20, 5) (starts from data)
Mistake 2: Confusing wrap_count with row count
wrap_count is the number of values per output row, not total rows.
Wrong thinking: “I want 3 rows” → wrap_count = 3
Correct thinking: “I want 4 items per row” → wrap_count = 4
Mistake 3: Providing two-dimensional range as vector
WRAPROWS only accepts one-dimensional arrays.
Wrong: =WRAPROWS(A1:C10, 5) (two-dimensional range)
Correct: =WRAPROWS(TOCOL(A1:C10), 5) (flattened to one dimension)
Mistake 4: Not clearing cells below the formula
If cells directly below contain data, WRAPROWS cannot spill.
Solution: Always place WRAPROWS in a location with adequate empty space below and to the right.
Mistake 5: Expecting #N/A to disappear without pad_with
The default behavior fills empty cells with #N/A.
Remember: Always specify pad_with unless #N/A is your intended output.
WRAPROWS vs. Alternative Methods
| Method | Pros | Cons |
|---|---|---|
| WRAPROWS Formula | One-line solution, dynamic, spills automatically, combines with other functions | Requires Microsoft 365, #N/A padding without custom value |
| Manual Copy-Paste | Works in all Excel versions | Time-consuming, error-prone, doesn’t update dynamically |
| Transpose + VSTACK/HSTACK | Works with older Excel versions | Complex multi-step process, difficult to maintain |
| Power Query | Powerful for complex transformations | Steeper learning curve, less transparent for casual users |
| Helper Columns + INDEX | Works in older versions | Requires multiple helper columns, clutters spreadsheet |
Availability and Compatibility
WRAPROWS is available in Microsoft 365 for Windows, Mac, and Excel for the web. It is not available in perpetual versions like Excel 2019, 2016, or earlier. For older Excel versions, you’ll need to use manual arrangement, helper column formulas, or Power Query as alternatives.
Tips for Mastering WRAPROWS
- Clean your data first: Use FILTER to remove blanks before wrapping to avoid spacing issues.
- Always specify pad_with: Even for internal reporting, be explicit about padding to avoid #N/A clutter.
- Test wrap counts visually: Sketch the desired layout before settling on wrap_count values.
- Combine strategically: Pair WRAPROWS with SORT, UNIQUE, FILTER, and TOCOL for powerful reshaping pipelines.
- Place formulas strategically: Ensure ample empty space below and to the right to prevent spill errors.
- Document your layout: Add comments explaining the wrap count and final intended dimensions.
- Use meaningful pad values: Choose “-“, “”, or 0 depending on context for professional output.
- Monitor performance: Very large arrays can impact calculation speed; test with real data volumes.
Troubleshooting Guide
| Error | Cause | Solution |
|---|---|---|
| #SPILL! | Cells to the right or below are occupied | Clear cells in the spill range or move formula to a location with empty space |
| #VALUE! | Input array is two-dimensional, not one-dimensional | Use TOCOL or TOROW to flatten the input first: =WRAPROWS(TOCOL(A1:C10), 5) |
| #NUM! | wrap_count is less than 1 or invalid | Ensure wrap_count is a positive integer greater than 0 |
| #N/A in output | Last row not fully filled and no pad_with specified | Add pad_with argument: =WRAPROWS(A1:A20, 5, “”) |
| #NAME? | Function not recognized | Verify Microsoft 365 subscription; update Excel to latest version |
| Blank cells in output | Source contains blanks that flow through | Filter out blanks first: =WRAPROWS(FILTER(A:A, A:A <> “”), 5, “”) |
Performance Considerations
- Large arrays: Wrapping extremely large arrays (50,000+ items) can impact calculation time. Test with real data volumes.
- Nested functions: Combining WRAPROWS with complex FILTER, SORT, or UNIQUE operations may reduce performance on large datasets.
- Spill range size: Larger output grids consume more memory. Monitor spreadsheet responsiveness.
- External references: Wrapping data pulled from external sources or other files increases recalculation time.
- Dependent formulas: Many formulas referencing the WRAPROWS output with
#can compound performance impact.
Advanced Scenarios
Creating a dynamic product photo grid
=WRAPROWS(
SORT(
FILTER(ProductDB[Image_URL], ProductDB[Category] = Selected_Category),
1, 1
),
4,
""
)
Filters products by category, sorts alphabetically, and arranges image URLs in a 4-column grid for web display.
Building a floor plan from occupant list
=WRAPROWS(
SORT(Team_Members),
6,
""
)
Arranges team members into a 6-person-per-row layout for office seating assignments.
Multi-language survey display
=WRAPROWS(
FILTER(SurveyOptions, SurveyOptions[Language] = ActiveLanguage),
5,
""
)
Displays survey options in the selected language, wrapped into a 5-column responsive grid.
Combined reshape and deduplication pipeline
=SORT(
WRAPROWS(
UNIQUE(
TOCOL(
HSTACK(Sales_Region_A, Sales_Region_B, Sales_Region_C)
)
),
4,
""
),
1, 1
)
Combines sales from three regions, flattens to a list, removes duplicates, wraps into rows, and sorts alphabetically.

