Convert an Excel Range to a Dynamic Column or Row
Question details
Convert a two-dimensional range into a single dynamic column or row, optionally excluding blanks and duplicates.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The user wants to reshape the values in a range into a one-dimensional array that updates when source values change.
- Observed behavior
- The desired result is a spilled column or row containing the range values, with optional blank filtering and duplicate removal.
Check that your Excel version supports TOCOL and TOROW, and identify the source range you want to reshape. Leave enough empty cells below or to the right of the formula for the result to spill.
Use TOCOL or TOROW to reshape the range
Create a dynamic column or row and optionally skip blanks and remove duplicates.
Select an empty cell outside the source range B2:Q350, with room below it for a column or to its right for a row.
Enter =TOCOL(B2:Q350,1) for a column or =TOROW(B2:Q350,1) for a row, then press Enter. The argument 1 skips blank cells.
For a column of unique values, enter =UNIQUE(TOCOL(B2:Q350,1)). For a row of unique values, enter =UNIQUE(TOROW(B2:Q350,1),TRUE); TRUE tells UNIQUE to compare columns.

Reshape spreadsheet ranges in WPS Office
In a WPS Spreadsheet version that supports TOCOL, TOROW, and UNIQUE, use the same dynamic array formulas to turn a range into a column or row.
- 1. Open the workbook: Open WPS Spreadsheet and use File > Open to select your Excel workbook.
- 2. Select an output cell: Click an empty cell outside the source range, leaving space for the result to spill.
- 3. Enter a formula: If your WPS version supports the function, enter =TOCOL(B2:Q350,1) for a column or =TOROW(B2:Q350,1) for a row, then press Enter.
- 4. Remove duplicates if needed: Use =UNIQUE(TOCOL(B2:Q350,1)) for a unique column or =UNIQUE(TOROW(B2:Q350,1),TRUE) for a unique row. If the functions are unavailable, use a supported Excel version for these formulas.

Frequently Asked Questions
How do I keep blank cells in the result?
Omit the ignore argument or set it to 0, for example =TOCOL(B2:Q350,0).
Why does Excel show a #SPILL! error?
The output area may be blocked. Clear cells below the TOCOL formula or to the right of the TOROW formula, then check the result again.
Why does UNIQUE need TRUE for a row?
UNIQUE compares rows by default. In =UNIQUE(TOROW(B2:Q350,1),TRUE), TRUE makes it compare the columns in the spilled row.
Will the formula include rows added below B2:Q350?
Not automatically. Update the range reference in the formula or use a suitable expanding table reference.




