{
  "category": "Math and trigonometry functions",
  "display_name": "PERCENTOF",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.PERCENTOF",
  "implementation_state": {
    "answer_bank": null,
    "detail": "Recorded: 18 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 18 recorded answers",
    "workbook_corpus": {
      "cells": 18,
      "matched": 18
    }
  },
  "implementations": [
    {
      "commit": "9e1884369a678158dd82d3d74188daf986995e87",
      "flavour": "excel-compatibility-candidate",
      "language": "Rust",
      "name": "CalcFunc",
      "own_code": [
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/group_pivot.rs#L21-L32",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/group_pivot.rs#L35-L63",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/group_pivot.rs#L65-L76"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/aggregate::direct_first",
        "catalogue/aggregate::number_of",
        "catalogue/aggregate::each_number",
        "catalogue/aggregate::read_values",
        "catalogue/aggregate::reader",
        "catalogue/aggregate::read_reference"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/group_pivot.rs#L21-L32",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 18 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.PERCENTOF.json",
  "name": "PERCENTOF",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n`SUM(subset)/SUM(all)` expresses the documented arithmetic relationship. [GROUPBY](FUNC.GROUPBY.md) and [PIVOTBY](FUNC.PIVOTBY.md) supply grouping context.\n\n\n",
    "how-to-implement": "\nRead each argument under its aggregate admission rules, accumulating each total with the established arithmetic-site addition. Divide subset total by whole total at a stored site and apply zero-denominator/error policy. In a grouping callback the caller supplies both the local values and the appropriate comparison set; the latter need not be the entire original data table. The example gives `5/20=0.25`. Keep collection origin so direct and held error handling do not become indistinguishable.\n\n\n",
    "quirks": "\nThe function does not verify that the first set is a literal subset of the second; supplied totals can produce a value above one or below zero. A zero denominator gives `#DIV/0!`. In recorded build-20527 controls, direct numeric text/logicals convert, while errors held in a reference or array collapse to `#NUM!`; a direct error retains its own code.\n\n\n",
    "sources": "\n- [Microsoft: PERCENTOF function](https://support.microsoft.com/en-us/excel/functions/percentof-function), opened 6 November 2026; syntax, documented argument rules and errors.\n- [DnaCalc implementation](https://github.com/DnaCalc/DnaCalc/blob/da3ecc4fb19a3a5529708c311d0e8f05688ac165/crates/calc-func/src/catalogue/group_pivot.rs); implementation steps and the limits identified in the text.\n\n",
    "try-it": "\n`=PERCENTOF({2,3},{2,3,5,10})` returns `0.25`, displayed as 25 percent with percentage formatting. The subset sums to five and the full set to twenty.\n\nThe denominator is a supplied comparison set. In a pivot cell with amount three, `PERCENTOF(3,{3,5})` gives `0.375`, while `PERCENTOF(3,{3,7})` gives `0.3`. The same numerator can therefore describe a column share or a row share. PIVOTBY's relative_to argument chooses that second set for a callback.\n\n\n",
    "version-differences": "\nThe current implementation comments retain COM readings from Excel 16.0 build 20527 on 30 October 2026. They cover direct versus held coercion/errors, including `PERCENTOF(1,4)=0.25`. No same-input comparison with another named build is recorded here. Microsoft’s opened page lists Excel for Microsoft 365; that is product availability, not a measured build comparison.\n\n\n",
    "what-it-does": "\n`PERCENTOF(data_subset,data_all)` sums the first set and divides by the sum of the second. It is useful as a two-argument aggregation callback in GROUPBY and PIVOTBY. The result is a fraction; percentage cell formatting changes its display.\n\n\n"
  },
  "signature": {
    "display": "PERCENTOF(data_subset, data_all)",
    "parameters": [
      {
        "description": null,
        "name": "data_subset",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "data_all",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 2,
        "min": 2
      },
      "category": "Math and trigonometry functions",
      "classification": {
        "arg_preparation_profile": "ValuesOnlyPreAdapter",
        "coercion_lift_profile": "Custom",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "None",
        "fec_dependency_profile": "None",
        "host_interaction_class": "None",
        "kernel_signature_class": "Custom",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Share of a subset in a total, as a fraction",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Sums the values in the subset and divides it by all the values",
        "microsoft_url": "https://support.microsoft.com/en-us/office/percentof-function-7c66da0a-ac30-45d0-bfc7-834a8bd7c962"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "PERCENTOF"
        },
        {
          "locale": "bg-BG",
          "name": "PERCENTOF"
        },
        {
          "locale": "cs-CZ",
          "name": "PROCENTO"
        },
        {
          "locale": "da-DK",
          "name": "PROCENTAF"
        },
        {
          "locale": "de-DE",
          "name": "PERCENTOF"
        },
        {
          "locale": "el-GR",
          "name": "PERCENTOF"
        },
        {
          "locale": "en-AU",
          "name": "PERCENTOF"
        },
        {
          "locale": "en-GB",
          "name": "PERCENTOF"
        },
        {
          "locale": "en-US",
          "name": "PERCENTOF"
        },
        {
          "locale": "es-ES",
          "name": "PORCENTAJEDE"
        },
        {
          "locale": "et-EE",
          "name": "PERCENTOF"
        },
        {
          "locale": "fi-FI",
          "name": "PERCENTOF"
        },
        {
          "locale": "fr-FR",
          "name": "POURCENTAGE.DE*"
        },
        {
          "locale": "he-IL",
          "name": "PERCENTOF"
        },
        {
          "locale": "hr-HR",
          "name": "PERCENTOF"
        },
        {
          "locale": "hu-HU",
          "name": "SZÁZALÉKA"
        },
        {
          "locale": "id-ID",
          "name": "PERCENTOF"
        },
        {
          "locale": "it-IT",
          "name": "PERCENTOF"
        },
        {
          "locale": "ja-JP",
          "name": "PERCENTOF"
        },
        {
          "locale": "ko-KR",
          "name": "PERCENTOF"
        },
        {
          "locale": "lt-LT",
          "name": "PERCENTOF"
        },
        {
          "locale": "lv-LV",
          "name": "PERCENTOF"
        },
        {
          "locale": "nb-NO",
          "name": "PERCENTOF"
        },
        {
          "locale": "nl-NL",
          "name": "PERCENTOF"
        },
        {
          "locale": "pl-PL",
          "name": "ODSETEK"
        },
        {
          "locale": "pt-BR",
          "name": "PERCENTOF"
        },
        {
          "locale": "pt-PT",
          "name": "PERCENTAGEMDE"
        },
        {
          "locale": "ro-RO",
          "name": "PERCENTOF"
        },
        {
          "locale": "ru-RU",
          "name": "ПРОЦЕНТ"
        },
        {
          "locale": "sk-SK",
          "name": "PERCENTOF"
        },
        {
          "locale": "sl-SI",
          "name": "PERCENTOF"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "PERCENTOF"
        },
        {
          "locale": "sv-SE",
          "name": "PROCENTAV"
        },
        {
          "locale": "th-TH",
          "name": "PERCENTOF"
        },
        {
          "locale": "tr-TR",
          "name": "PERCENTOF"
        },
        {
          "locale": "uk-UA",
          "name": "PERCENTOF"
        },
        {
          "locale": "vi-VN",
          "name": "PERCENTOF"
        },
        {
          "locale": "zh-CN",
          "name": "PERCENTOF"
        },
        {
          "locale": "zh-HK",
          "name": "PERCENTOF"
        },
        {
          "locale": "zh-TW",
          "name": "PERCENTOF"
        }
      ],
      "signature": {
        "display": "PERCENTOF(data_subset, data_all)",
        "parameters": [
          {
            "description": null,
            "name": "data_subset",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "data_all",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "PERCENTOF",
      "version_marker": null,
      "xlcall": null
    },
    "microsoft": "https://support.microsoft.com/en-us/office/percentof-function-7c66da0a-ac30-45d0-bfc7-834a8bd7c962"
  },
  "try_it": {
    "formula": "=PERCENTOF({2,3},{2,3,5,10})"
  },
  "url": "https://handbook.dnacalc.com/functions/PERCENTOF.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "COM controls retained in the implementation on 30 October 2026 include PERCENTOF(1,4)=0.25 and direct-versus-held coercion/error cases. No same-input other-build comparison is recorded.",
      "excel_build": "16.0 build 20527",
      "platform": "Windows through COM; bitness and CPU not stated in these comments",
      "sources": [
        "https://github.com/DnaCalc/DnaCalc/blob/da3ecc4fb19a3a5529708c311d0e8f05688ac165/crates/calc-func/src/catalogue/group_pivot.rs"
      ]
    }
  ]
}