PERCENTOF

Short answer

Mix and share-of-total in one step

PERCENTOF(data_subset, data_all)
Excel version
365
Also searched as
percent of total, share of total, revenue mix, percentage of grand total, allocation percentage

What it returns

PERCENTOF adds up data_subset, adds up data_all, and divides the first by the second. The result is a decimal: 0.25 for a quarter of the total. Format the cell as a percentage.

On a single cell it saves little over D12/SUM(D$12:D$18). It pays off as the function argument in GROUPBY and PIVOTBY. There, each group’s share of the total spills beside the group with no helper column and no anchored denominator.

When data_all sums to zero, the division fails and you get #DIV/0!.

Arguments that matter

ArgumentRequiredWhat it does
data_subsetYesThe part. A cell, a range, or an array such as the output of FILTER. Summed before dividing.
data_allYesThe whole. The full column or range the subset belongs to. Summed before dividing.

The rule that keeps the result honest: the subset has to be part of the whole. If data_subset reads from a different Table, period or filter than data_all, the share can run above 100% and nothing flags it.

Inside GROUPBY and PIVOTBY you do not write either argument. You pass the bare name, PERCENTOF, and the function supplies each group as the subset and the full values column as the whole. In PIVOTBY, the relative_to argument changes the whole: column totals by default, or row totals, the grand total, or parent totals.

In a financial model

Mix is everywhere in a model. Revenue by segment as a share of total revenue. Opex by department as a share of total opex. Each customer’s share of the top line, for a concentration disclosure.

The second use is allocation. A shared cost, such as IT or rent, is spread across cost centers by a driver: headcount, square footage, revenue. Each cost center’s share of the driver is a PERCENTOF. The cost to allocate is an input on the assumptions tab, multiplied in, never typed into the formula, per no constants inside formulas.

In a fixed grid, the classic share formula needs the denominator anchored with $ so it holds when filled. Getting that anchor wrong is a common way for a mix column to drift, which is what anchor references deliberately warns about. PERCENTOF still needs data_all anchored in a grid. Inside GROUPBY and PIVOTBY, there is nothing to anchor.

Worked example

A revenue extract on tab Rev, a Table with columns Month, Customer, Segment, Amount, signed positive. The review tab needs each segment’s revenue and its share of the total.

=GROUPBY(Rev[Segment], Rev[Amount], HSTACK(SUM, PERCENTOF), 0, 1, -2)

HSTACK(SUM, PERCENTOF) runs both aggregations over the same groups. The -2 sorts by the summed revenue, largest first.

SegmentSumShare
Enterprise6,840,00057.0%
Mid-market3,360,00028.0%
SMB1,800,00015.0%
Total12,000,000100.0%

Format the third column as a percentage. A new segment in the extract appears as a new row with its share, and the existing shares rebase automatically.

For an allocation driver, the share of FTEs in the cost center named in B12, from a headcount Table HC:

=PERCENTOF(FILTER(HC[FTE], HC[CostCenter]=$B12), HC[FTE])

Multiply by the shared cost held on the inputs tab to get the allocated amount. Fill down for every cost center and the allocations sum back to the shared cost. Put that tie-out in the check row.

Old way vs new way

The old mix column, filled down beside a summary:

=D12/SUM(D$12:D$18)

The new one comes out of the summary itself:

=GROUPBY(Rev[Segment], Rev[Amount], HSTACK(SUM, PERCENTOF))

The old column had to match the summary’s length by hand, and a new segment past row 18 sat outside the denominator. The GROUPBY version sizes itself, so the shares always cover every row and the total always reads 100%.

Where it breaks

PERCENTOF returns #NAME?. The workbook is open in Excel 2024 or earlier, where PERCENTOF does not exist. Fix: use x/SUM(x) with an anchored denominator if the file has to travel to perpetual licenses.

PERCENTOF returns #DIV/0!. data_all sums to zero. A month with no revenue, or a driver column where every cost center reads zero, does this. Fix: decide what a zero base should show and test for it before dividing, for example with IF on the total, rather than wrapping the formula in IFERROR, which would also hide a broken reference.

Shares above 100% or below zero. The data mixes signs. Credit notes, contra-revenue, or P&L rows signed the ledger way (revenue negative, costs positive) all distort the base. Fix: run mix on a column with one consistent sign. Filter out contra lines, or compute mix on revenue alone.

The shares do not add to 100%. In a grid, data_all was not anchored and slid down as the formula filled. Or the subset came from a different filter than the whole. Fix: anchor data_all with $, and read both arguments from the same Table and the same period.

PERCENTOF returns #CALC! inside the allocation formula. The FILTER found no rows for that cost center and returned an empty array. Fix: give FILTER its third argument, 0, so a cost center with no headcount gets a zero share.

PIVOTBY shares run the wrong direction. You wanted each line’s share of its row total across the months, and got each line’s share of the month. Column totals are the default base. Fix: set relative_to in PIVOTBY to use row totals.

Related functions

  • GROUPBY. Where PERCENTOF does its best work. Pass it as the function, or stack it with SUM, to get a mix column that sizes itself.
  • PIVOTBY. The matrix version. Mix by line per month, with relative_to choosing the base.
  • SUMIFS. For a fixed grid of amounts. Divide one SUMIFS by the grid total when the layout cannot move.
  • FILTER. Builds the subset when PERCENTOF stands alone, as in the allocation example.
  • SUMPRODUCT. For the weighted average that often follows a mix, such as a blended margin across segments.
  • The play no constants inside formulas covers where the cost to allocate should live.

All functions