How to Use VSTACK and LAMBDA to Author Cumulative Frequency Concentration Curves in Microsoft Excel

In market structure analysis, portfolio risk management, and operational auditing, measuring resource concentration is vital for identifying vulnerabilities. Whether analyzing market share dominance among competing firms (Herfindahl-Hirschman Index and CR4 concentration ratios) or assessing customer revenue reliance, cumulative concentration curves visually illustrate how aggregate output clusters among top contributors. By leveraging modern dynamic array primitives including VSTACK, SORT, SCAN, and LAMBDA, you can build a self-contained concentration curve model in Microsoft Excel that recalculates dynamically.

Understanding Concentration Curve Mechanics

Unlike standard Lorenz curves (which sort observations in ascending order from smallest to largest), a Concentration Curve sorts observations in descending order from largest to smallest contributor:

  • Horizontal Axis (Cumulative Entity Count / %): Top N contributors or cumulative percentile of entities.
  • Vertical Axis (Cumulative Output Share %): Cumulative proportion of total market revenue or operational output generated by those top entities.
  • Steepness of Curvature: A curve that rises sharply towards 80% within the first 10% of entities demonstrates extreme market or revenue concentration.
  • Four-Firm Concentration Ratio (CR4): The cumulative market share controlled by the top 4 entities, serving as a standard antitrust benchmark.

Setting Up the Entity and Revenue Data Layout

Assume competitor company names or product IDs occupy column range A2:A50 and their annual revenues reside in B2:B50:

  1. Ensure column B contains valid positive numbers without intervening empty rows.
  2. Select an adjacent empty cell (such as D2) to host the dynamic array concentration formula.

Constructing the Unified Dynamic Concentration Formula

Enter the following comprehensive LET formula into cell D2 to calculate cumulative concentration coordinates, percentages, and headers:

=LET(
    names, A2:A50,
    values, B2:B50,
    data, FILTER(HSTACK(names, values), ISNUMBER(values)),
    sorted_matrix, SORT(data, 2, -1),
    sorted_names, CHOOSECOLS(sorted_matrix, 1),
    sorted_vals, CHOOSECOLS(sorted_matrix, 2),
    n, ROWS(sorted_vals),
    total_val, SUM(sorted_vals),
    rank_idx, SEQUENCE(n),
    pop_pct, rank_idx / n,
    cum_vals, SCAN(0, sorted_vals, LAMBDA(acc,v, acc + v)),
    cum_share, cum_vals / total_val,
    anchored_rank, VSTACK(0, rank_idx),
    anchored_pop, VSTACK(0, pop_pct),
    anchored_share, VSTACK(0, cum_share),
    table_body, HSTACK(anchored_rank, VSTACK("Origin", sorted_names), anchored_pop, anchored_share),
    header, {"Rank", "Entity Name", "Cumulative Population %", "Cumulative Concentration Share"},
    VSTACK(header, table_body)
)

Formula Workflow and Logical Mechanics

This dynamic array pipeline executes systematically through structured evaluation blocks:

  • Descending Sort (SORT): Sorts records in descending order (-1) based on value, placing the largest contributors at rank 1.
  • Vector Enumeration (SEQUENCE): Creates sequential rank positions from 1 to n, calculating fractional population percentiles (pop_pct).
  • Cumulative Aggregation (SCAN): Progressively accumulates revenue values down the array, dividing by total_val to determine cumulative concentration share.
  • Baseline Origin Anchoring (VSTACK): Prepends rank 0 and 0.0% share to ensure the concentration curve strictly originates at coordinate (0, 0).
  • Matrix Assembly: Combines column labels and computed vectors into a self-formatting summary table.

Extracting Concentration Key Metrics (CR4 and CR8)

To extract standard industry concentration metrics dynamically from the spilled results in an adjacent summary cell:

=LET(
    share_col, INDEX(D3#, 0, 4),
    cr4, INDEX(share_col, 5), // Rank 4 (offset by header and origin)
    cr8, INDEX(share_col, 9), // Rank 8
    VSTACK(
        {"Metric", "Concentration Share"},
        HSTACK("CR4 (Top 4 Share)", TEXT(cr4, "0.0%")),
        HSTACK("CR8 (Top 8 Share)", TEXT(cr8, "0.0%"))
    )
)

Generating the Visual Concentration Curve Chart

To plot the concentration curve:

  1. Select the spilled Cumulative Population % and Cumulative Concentration Share columns.
  2. Navigate to Insert > Scatter with Smooth Lines.
  3. Format both axes: set minimum bounds to 0.0, maximum bounds to 1.0, and apply percentage number formatting.
  4. The steep initial trajectory of the curve illustrates dependency risk and market power concentration dynamically as underlying transactions update.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.