Modern Matrix Reshaping: CHOOSECOLS, CHOOSEROWS, TOCOL, TOROW
Overview & Learning Objectives
Modern data shaping functions in Excel 365 allow analysts to slice, flatten, trim, and reorder tabular data with clean single-formula expressions—eliminating copy-paste manipulation.
- Extract specific non-adjacent columns with CHOOSECOLS.
- Flatten 2D matrices into single vertical columns with TOCOL.
- Extract Top N and Bottom N subsets with TAKE.
- Trim headers and discard unwanted peripheral rows with DROP.
Industry Standard
Standard: BI data preparation pipelines in modern Excel rely on CHOOSECOLS and TOCOL to reshape wide ERP matrices into normalized relational tables ready for Power BI.
Real-World Example: Retail Multi-Store Matrix Flattening & Executive Extraction
At QuickMart Retail, monthly sales are entered in a wide matrix (Stores as Rows, Months as Columns). An analyst uses TOCOL to flatten all monthly sales into a clean 1-column list and TAKE to grab the top 3 stores.
| Store Code | Jan Sales (₹) | Feb Sales (₹) | Mar Sales (₹) |
|---|---|---|---|
| STR-01 (Koramangala) | 45,000 | 52,000 | 61,000 |
| STR-02 (Indiranagar) | 68,000 | 71,000 | 84,000 |
| STR-03 (Whitefield) | 32,000 | 39,000 | 41,000 |
Functions Covered in this Chapter
Here is the definition, exact syntax, parameter breakdown, and real-world business example for each function covered in this chapter:
CHOOSECOLS Function
Definition: Returns specific columns from an array by column index numbers, enabling instant column reordering and extraction.
=CHOOSECOLS(array, col_num1, [col_num2], ...)
array: The source data grid (A2:D4).col_num1, [col_num2]: The 1-based column indices to extract (e.g. 1 and 4).
=CHOOSECOLS(A2:D4, 1, 4)TOCOL Function
Definition: Flattens a two-dimensional matrix or grid of cells into a single vertical column.
=TOCOL(array, [ignore], [scan_by_column])
array: The 2D grid to flatten (B2:D4).[ignore]: 0=Keep all (default), 1=Ignore blanks, 2=Ignore errors, 3=Ignore blanks and errors.[scan_by_column]: FALSE to scan row-by-row (default); TRUE to scan column-by-column.
=TOCOL(B2:D4)TAKE Function
Definition: Extracts a specified number of contiguous rows or columns from the start or end of an array.
=TAKE(array, rows, [columns])
array: The source range.rows: Number of rows to take. Positive takes from top; negative takes from bottom.[columns]: Number of columns to take (optional).
=TAKE(A2:D4, 2)DROP Function
Definition: Excludes a specified number of rows or columns from the start or end of an array.
=DROP(array, rows, [columns])
array: The source data.rows: Number of rows to exclude. Positive drops from top; negative drops from bottom.[columns]: Number of columns to exclude.
=DROP(A2:D4, 1)Common Mistakes & Limitations
- Using negative index numbers incorrectly: In TAKE, `-3` takes the LAST 3 items, whereas in DROP, `-3` REMOVES the last 3 items.
- Trying to use TOCOL or CHOOSECOLS in Excel 2019 or older; these are modern array functions exclusive to Excel 365 and Excel for Web.
Keyboard Shortcuts
| Action | Windows | Mac |
|---|---|---|
| Spill Range Anchor Reference | Click spilled cell -> Type # | Type # |
| Expand Formula Bar | Ctrl + Shift + U | Ctrl + Shift + U |
Pro Tips & Modern Alternatives
- Use `CHOOSEROWS` and `TOROW` for corresponding horizontal operations.
- Combine `TAKE(SORT(A2:D4, 4, -1), 1)` to extract the #1 best performing store.