Segmentation by deciles is a cornerstone statistical technique in customer valuation, credit risk scoring, and performance benchmarking. Segmenting a dataset into 10 equally sized groups reveals granular performance disparities that broad quartiles often conceal. In legacy Excel workflows, computing deciles required fragile helper columns utilizing ROUNDUP, manual sorting, and complex pivot groupings. By leveraging modern dynamic array primitives including VSTACK, PERCENTRANK.INC, and LAMBDA, you can build a self-contained decile ranking matrix that spills automatically from a single formula cell.
Understanding Decile Ranking Mathematics
Decile ranking divides a sorted population into 10 equal parts (tiers 1 through 10):
- Decile 1 (Bottom 10%): Observations falling between the 0th and 10th percentile.
- Decile 5 (Median Tier): Observations clustered around the 50th percentile.
- Decile 10 (Top 10%): Elite observations exceeding the 90th percentile.
- Percentile Ranking (
PERCENTRANK.INC): Computes the relative rank of a value within a data array as a percentage between 0 and 1. Multiplying by 9 and adding 1 (or takingINT(rank * 10) + 1) cleanly maps observations into integer decile tiers.
Setting Up the Source Data Layout
Assume client account names occupy column range A2:A100 and associated annual contract values occupy B2:B100:
- Verify that column B contains valid numerical amounts without blank intervening rows.
- Select an adjacent cell (such as
D2) to house the dynamic decile analysis table.
Constructing the Unified Dynamic Decile Formula
Enter the following comprehensive LET formula into cell D2 to generate the complete sorted decile table alongside descriptive labels and summary headers:
=LET(
names, A2:A100,
values, B2:B100,
sorted_matrix, SORT(HSTACK(names, values), 2, -1),
sorted_names, CHOOSECOLS(sorted_matrix, 1),
sorted_vals, CHOOSECOLS(sorted_matrix, 2),
pct_ranks, PERCENTRANK.INC(sorted_vals, sorted_vals),
deciles, MAP(pct_ranks, LAMBDA(r, MIN(10, INT(r * 10) + 1))),
tier_labels, MAP(deciles, LAMBDA(d, "Decile " & d)),
header, {"Customer / Entity", "Value", "Percentile Rank", "Decile Tier", "Decile Group"},
table_body, HSTACK(sorted_names, sorted_vals, pct_ranks, deciles, tier_labels),
VSTACK(header, table_body)
)
Formula Workflow and Logical Mechanics
This dynamic array formula executes systematically through structured evaluation stages:
- Matrix Sorting (
SORT): Horizontally binds customer names and monetary values, immediately sorting rows in descending order (-1) based on the monetary value column. - Column Slicing (
CHOOSECOLS): Separates the sorted matrix into isolated customer and numerical vectors for vectorized percentile evaluation. - Percentile Calculation (
PERCENTRANK.INC): Evaluates each value against the full distribution, returning a precise relative percentile position between 0.000 and 1.000. - Decile Mapping (
MAP & INT): Multiplies percentile ranks by 10 and applies integer truncation. TheMIN(10, ...)wrapper prevents floating-point overflow for the highest value. - Header and Matrix Assembly (
VSTACK): Assembles descriptive column headers above the calculated rows to deliver a complete, publication-ready summary.
Summarizing Deciles Using a Secondary Pivot Spill
To extract an aggregated summary table showing average value and total count per decile tier:
=LET(
tier_col, INDEX(D3#, 0, 4),
val_col, INDEX(D3#, 0, 2),
unique_tiers, SEQUENCE(10),
tier_counts, MAP(unique_tiers, LAMBDA(t, COUNTIF(tier_col, t))),
tier_totals, MAP(unique_tiers, LAMBDA(t, SUMIF(tier_col, t, val_col))),
tier_avgs, tier_totals / tier_counts,
summary_body, HSTACK(unique_tiers, tier_counts, tier_totals, tier_avgs),
summary_header, {"Decile", "Record Count", "Total Revenue", "Average Value"},
VSTACK(summary_header, summary_body)
)
Formatting and Reporting Presentation
To prepare the output tables for executive reporting:
- Format the Percentile Rank column as percentages with one decimal place (
0.0%). - Format monetary figures using currency or integer number formats (
$#,##0). - Apply subtle conditional formatting across the Decile Tier column: color-code Decile 10 (top tier) in soft green and Decile 1 in soft amber to immediately identify customer concentration.