PERCENTOF Function¶
The PERCENTOF function in Excel is used to calculate what fraction of a whole a subset represents. It sums the subset, sums the whole, and returns the ratio between them. This saves writing SUM(...)/SUM(...) by hand and makes share-of-total calculations read more clearly.
PERCENTOF is a newer Excel function, available in Microsoft 365.
Key Features of PERCENTOF:¶
- Returns
SUM(data_subset) / SUM(data_all)as a decimal fraction —0.2, not20%. Apply a percentage number format to display it as a percentage. - Accepts scalars or ranges for either argument.
- The two arguments are summed independently, so they do not need to be the same size or shape.
- Returns
#DIV/0!when the whole sums to zero. - The subset does not have to be contained within the whole; results above
1(100%) and below0are both possible.
Syntax:¶
- data_subset: The value or range making up the part.
- data_all: The value or range making up the whole.
How PERCENTOF Works:¶
PERCENTOFsums every numeric value indata_subset.- It sums every numeric value in
data_all. - If the second sum is zero, it returns
#DIV/0!. - Otherwise it returns the first sum divided by the second.
Examples:¶
1. Two Scalars:¶
Result:
2. A Range Within a Range:¶
If A1:A3 contains 1, 2, 3:
Result:
3. Share of a Total:¶
If B2:B5 holds regional sales and B2 is the region of interest:
Result:
4. Division by Zero:¶
Result:
5. Ranges of Different Sizes:¶
If A1:A4 sums to 4 and B1 contains 8:
Result:
6. A Subset Larger Than the Whole:¶
Result:
7. Negative Values:¶
Result:
8. Guarding Against an Empty Total:¶
Result:
Notes:¶
PERCENTOFreturns a decimal fraction. Format the cell as a percentage to display0.2as20%; the underlying value is unchanged.PERCENTOF(x, y)is equivalent toSUM(x)/SUM(y), including the#DIV/0!behaviour when the divisor is zero.- An empty or all-zero
data_allproduces#DIV/0!. Adata_allwhose values cancel out — such as5and-5— does too. - An empty
data_subsetsums to zero, so the result is0. - Text and blank cells within either range are ignored by the summation, as they are by
SUM. PERCENTOFis a Microsoft 365 function. Older Excel versions will show#NAME?; useSUM(...)/SUM(...)for backwards compatibility.
Applications:¶
- Share of Total: Express each region, product, or category as a percentage of the overall figure.
- Budget Analysis: Show what proportion of a total budget a line item consumes.
- Progress Tracking: Report completed work as a fraction of total planned work.
- Composition Reporting: Break a population down into percentage contributions.
- Variance Analysis: Compare a subset's contribution across periods without repeating
SUMtwice per formula.
Related Functions:¶
- SUM: Adds all the numbers in a range — the operation
PERCENTOFapplies to each argument. - QUOTIENT: Returns the integer portion of a division.
- SUMPRODUCT: Multiplies corresponding components and returns the sum of those products.
- PERCENTILE: Returns the k-th percentile of values in a range.
- IFERROR: Returns a specified value if a formula evaluates to an error; useful for trapping
#DIV/0!.
Tip: Because the two arguments are summed independently,
PERCENTOFwill happily compare unrelated ranges. That flexibility is useful — comparing this quarter's subset against last year's total, for example — but it also means a mistyped range produces a plausible-looking number rather than an error. Double-check the second argument really is the whole you meant.