Advanced Excel for Data AnalystsLesson 40 of 49
Lesson 40 of 49

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 CodeJan Sales (₹)Feb Sales (₹)Mar Sales (₹)
STR-01 (Koramangala)45,00052,00061,000
STR-02 (Indiranagar)68,00071,00084,000
STR-03 (Whitefield)32,00039,00041,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:

Function 1

CHOOSECOLS Function

Definition: Returns specific columns from an array by column index numbers, enabling instant column reordering and extraction.

Syntax:
=CHOOSECOLS(array, col_num1, [col_num2], ...)
Parameters Breakdown:
  • array: The source data grid (A2:D4).
  • col_num1, [col_num2]: The 1-based column indices to extract (e.g. 1 and 4).
Real-World Example (Extract Store & March Sales Only):
Problem / Scenario: Extract Column 1 (Store) and Column 4 (Mar Sales) without showing Jan/Feb.
Formula: =CHOOSECOLS(A2:D4, 1, 4)
Result: Spills 2-column table with Store Code and Mar Sales
Why it works: Skips columns 2 and 3 cleanly.
Function 2

TOCOL Function

Definition: Flattens a two-dimensional matrix or grid of cells into a single vertical column.

Syntax:
=TOCOL(array, [ignore], [scan_by_column])
Parameters Breakdown:
  • 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.
Real-World Example (Flatten 3 Months of Sales):
Problem / Scenario: Stack all 9 monthly sales numbers in B2:D4 into a single vertical column.
Formula: =TOCOL(B2:D4)
Result: Spills single 9-row column with all sales numbers
Why it works: Transforms cross-tab layout into a normalized vertical list.
Function 3

TAKE Function

Definition: Extracts a specified number of contiguous rows or columns from the start or end of an array.

Syntax:
=TAKE(array, rows, [columns])
Parameters Breakdown:
  • 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).
Real-World Example (Top 2 Stores Subset):
Problem / Scenario: Extract the first 2 rows of the table A2:D4.
Formula: =TAKE(A2:D4, 2)
Result: Spills rows for STR-01 and STR-02
Why it works: Takes top 2 rows directly.
Function 4

DROP Function

Definition: Excludes a specified number of rows or columns from the start or end of an array.

Syntax:
=DROP(array, rows, [columns])
Parameters Breakdown:
  • array: The source data.
  • rows: Number of rows to exclude. Positive drops from top; negative drops from bottom.
  • [columns]: Number of columns to exclude.
Real-World Example (Exclude Store 1):
Problem / Scenario: Drop the first row from table A2:D4.
Formula: =DROP(A2:D4, 1)
Result: Spills rows for STR-02 and STR-03
Why it works: Drops the top row cleanly.

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

ActionWindowsMac
Spill Range Anchor ReferenceClick spilled cell -> Type #Type #
Expand Formula BarCtrl + Shift + UCtrl + 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.