{
  "category": "Compatibility",
  "display_name": "PERCENTRANK",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.PERCENTRANK",
  "implementation_state": {
    "answer_bank": null,
    "detail": "Recorded: 66 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 66 recorded answers",
    "workbook_corpus": {
      "cells": 66,
      "matched": 66
    }
  },
  "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/statistics.rs#L308-L310"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/statistics::list",
        "catalogue/statistics::percent_rank",
        "ported/percentrank_common::percentrank",
        "ported/percentrank_common::exact_rank",
        "ported/percentrank_common::truncate_to_decimal_places"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/statistics.rs#L308-L310",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 66 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.PERCENTRANK.json",
  "name": "PERCENTRANK",
  "notes": [
    {
      "basis": "Two formula-literal rows in the landed statistics capture. Raw and reopened binary64 results agree, and the saved numeric text parses to those values. The first interpolated mathematical rank is about 0.0813559322; the second is 1/12. Six and three significant digits would retain 0.0813559 and 0.0833, respectively. This harvest made no new Excel calls.",
      "documentation": {
        "claim": "The opened PERCENTRANK and PERCENTRANK.INC pages describe significance as the number of significant digits; omission defaults to three.",
        "source": "https://support.microsoft.com/en-us/excel/functions/percentrank-function; https://support.microsoft.com/en-us/excel/functions/percentrank-inc-function"
      },
      "evidence": [
        {
          "commit": "da3ecc4fb19a3a5529708c311d0e8f05688ac165",
          "locator": "sheet dcj9k_statistics, rows 933 and 1028, column 4",
          "note": "Formula-literal answers and full environment, with raw/saved/reopened views.",
          "path": "crates/calc-func/tests/captures/catalogue/sections/dcj9k_statistics.capture.json",
          "repository": "DnaCalc"
        },
        {
          "commit": "da3ecc4fb19a3a5529708c311d0e8f05688ac165",
          "locator": "truncate_to_decimal_places",
          "note": "Current decimal-place truncation and its stated recorded scope.",
          "path": "crates/calc-func/src/ported/percentrank_common.rs",
          "repository": "DnaCalc"
        }
      ],
      "functions": [
        "FUNC.PERCENTRANK",
        "FUNC.PERCENTRANK.INC"
      ],
      "inferred": null,
      "kind": "documentation-differs",
      "note_id": "FN-PERCENTRANK-001",
      "open": [
        "These two controls do not establish all duplicate-selection, significance-limit or cross-build behaviour. PERCENTRANK.EXC shares the current helper but is not a measured precision discriminator in this note."
      ],
      "recorded_on": "2026-11-06",
      "repros": [
        {
          "call": "=PERCENTRANK({37.15,46,54},38.59,6)",
          "correct": null,
          "excel": {
            "bits": "0x3fb4d3ae685db76b",
            "display": "0.081355",
            "kind": "number"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), AMD Ryzen 7 4800H, en-ZA, Workbook Compatibility Version 1",
          "source": {
            "commit": "da3ecc4fb19a3a5529708c311d0e8f05688ac165",
            "locator": "sheet dcj9k_statistics, row 933, column 4; formulas, observations, saved and reopened",
            "note": "One capture with three retained views, not three independent runs.",
            "path": "crates/calc-func/tests/captures/catalogue/sections/dcj9k_statistics.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=PERCENTRANK.INC({0,1,2,3,4,5,6,7,8,9,10,11,12},1)",
          "correct": null,
          "excel": {
            "bits": "0x3fb53f7ced916873",
            "display": "0.083",
            "kind": "number"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), AMD Ryzen 7 4800H, en-ZA, Workbook Compatibility Version 1",
          "source": {
            "commit": "da3ecc4fb19a3a5529708c311d0e8f05688ac165",
            "locator": "sheet dcj9k_statistics, row 1028, column 4; formulas, observations, saved and reopened",
            "note": "One capture with three retained views, not three independent runs.",
            "path": "crates/calc-func/tests/captures/catalogue/sections/dcj9k_statistics.capture.json",
            "repository": "DnaCalc"
          }
        }
      ],
      "schema": "efh.function-note/v1",
      "statement": "In the retained catalogue capture, PERCENTRANK({37.15,46,54},38.59,6) returns 0.081355, and PERCENTRANK.INC({0,1,2,3,4,5,6,7,8,9,10,11,12},1) returns 0.083 with omitted significance. These results retain six and three decimal places respectively, and differ from keeping that many significant digits in the untruncated ranks. The scope is these two build 20527 calls.",
      "status": "measured",
      "title": "Two percent-rank controls retain decimal places rather than significant digits"
    }
  ],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n[PERCENTILE.INC](FUNC.PERCENTILE.INC.md) maps a fraction back to a value. [RANK.EQ](FUNC.RANK.EQ.md) returns an integer rank rather than a fraction.\n\n\n\n\n",
    "how-to-implement": "\nSort the admitted numbers. For distinct observations give zero-based index i the fraction `i/(n-1)`. Locate x exactly or bracket it by neighbouring values, then interpolate between their fractions. Finally apply `trunc(rank*10^d)/10^d`, using the admitted precision d. For the example the first two fractions are `0` and `1/3`; their midpoint is `1/6`, truncated to `0.166`. The current exact-match branch uses a binary search; its duplicate selection is an implementation detail and its tie policy outside these controls remains open.\n\n\n",
    "quirks": "\nA query outside the numeric data range gives `#N/A` in the current code. Significance below one gives `#NUM!`. Microsoft describes this argument as significant digits; the recorded helper instead truncates **decimal places**. Microsoft documents `#NUM!` for an empty array, while the current helper returns `#N/A`; that difference remains visible rather than silently promoted to an Excel rule. Duplicate-rank policy needs separate controls.\n\n\n",
    "sources": "\n- [Microsoft: PERCENTRANK function](https://support.microsoft.com/en-us/excel/functions/percentrank-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/ported/percentrank_common.rs); implementation steps and the limits identified in the text.\n\n",
    "try-it": "\n`=PERCENTRANK({10,20,30,40},15)` returns `0.166`. Fifteen is halfway between the first two observations, so its rank is interpolated before the returned decimal places are truncated.\n\n\n",
    "version-differences": "No same-input comparison between named Excel builds is recorded for this function here. The documented behaviour below is not a measurement of every Excel release.\n\nThe retained catalogue capture on Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), AMD Ryzen 7 4800H, en-ZA, Workbook Compatibility Version 1 records =PERCENTRANK({37.15,46,54},38.59,6) = 0.081355 (0x3fb4d3ae685db76b). Inputs were entered as the shown formula literal. Raw, saved and reopened views belong to one capture; this is not a comparison between builds.",
    "what-it-does": "\n`PERCENTRANK(array,x,[significance])` returns x’s fractional standing among numeric observations. The inclusive convention puts observed endpoints at zero and one. The omitted precision argument is three.\n\n\n"
  },
  "signature": {
    "display": "PERCENTRANK(array, x, [significance])",
    "parameters": [
      {
        "description": null,
        "name": "array",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "x",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "significance",
        "optional": true,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 3,
        "min": 2
      },
      "category": "Compatibility",
      "classification": {
        "arg_preparation_profile": "RefsVisibleInAdapter",
        "coercion_lift_profile": "Custom",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "None",
        "fec_dependency_profile": "RefOnly",
        "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": "Relative standing of a value in a data set, as a fraction (older form)",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the percentage rank of a value in a data set",
        "microsoft_url": "https://support.microsoft.com/en-us/office/percentrank-function-f1b5836c-9619-4847-9fc9-080ec9024442"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "PERCENTRANK"
        },
        {
          "locale": "bg-BG",
          "name": "PERCENTRANK"
        },
        {
          "locale": "cs-CZ",
          "name": "PERCENTRANK"
        },
        {
          "locale": "da-DK",
          "name": "PROCENTPLADS"
        },
        {
          "locale": "de-DE",
          "name": "PERCENTRANK"
        },
        {
          "locale": "el-GR",
          "name": "PERCENTRANK"
        },
        {
          "locale": "en-AU",
          "name": "PERCENTRANK"
        },
        {
          "locale": "en-GB",
          "name": "PERCENTRANK"
        },
        {
          "locale": "en-US",
          "name": "PERCENTRANK"
        },
        {
          "locale": "es-ES",
          "name": "RANGO.PERCENTIL"
        },
        {
          "locale": "et-EE",
          "name": "PERCENTRANK"
        },
        {
          "locale": "fi-FI",
          "name": "PROSENTTIJÄRJESTYS"
        },
        {
          "locale": "fr-FR",
          "name": "RANG.POURCENTAGE*"
        },
        {
          "locale": "he-IL",
          "name": "PERCENTRANK"
        },
        {
          "locale": "hr-HR",
          "name": "PERCENTRANK"
        },
        {
          "locale": "hu-HU",
          "name": "SZÁZALÉKRANG"
        },
        {
          "locale": "id-ID",
          "name": "PERCENTRANK"
        },
        {
          "locale": "it-IT",
          "name": "PERCENTRANK"
        },
        {
          "locale": "ja-JP",
          "name": "PERCENTRANK"
        },
        {
          "locale": "ko-KR",
          "name": "PERCENTRANK"
        },
        {
          "locale": "lt-LT",
          "name": "PERCENTRANK"
        },
        {
          "locale": "lv-LV",
          "name": "PERCENTRANK"
        },
        {
          "locale": "nb-NO",
          "name": "PROSENTDEL (funksjon)"
        },
        {
          "locale": "nl-NL",
          "name": "PERCENT.RANG"
        },
        {
          "locale": "pl-PL",
          "name": "PROCENT.POZYCJA"
        },
        {
          "locale": "pt-BR",
          "name": "PERCENTRANK"
        },
        {
          "locale": "pt-PT",
          "name": "ORDEM.PERCENTUAL"
        },
        {
          "locale": "ro-RO",
          "name": "PERCENTRANK"
        },
        {
          "locale": "ru-RU",
          "name": "ПРОЦЕНТРАНГ"
        },
        {
          "locale": "sk-SK",
          "name": "PERCENTRANK"
        },
        {
          "locale": "sl-SI",
          "name": "PERCENTRANK"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "PERCENTRANK"
        },
        {
          "locale": "sv-SE",
          "name": "PROCENTRANG"
        },
        {
          "locale": "th-TH",
          "name": "PERCENTRANK"
        },
        {
          "locale": "tr-TR",
          "name": "YÜZDERANK işlevi"
        },
        {
          "locale": "uk-UA",
          "name": "PERCENTRANK"
        },
        {
          "locale": "vi-VN",
          "name": "PERCENTRANK"
        },
        {
          "locale": "zh-CN",
          "name": "PERCENTRANK"
        },
        {
          "locale": "zh-HK",
          "name": "PERCENTRANK"
        },
        {
          "locale": "zh-TW",
          "name": "PERCENTRANK"
        }
      ],
      "signature": {
        "display": "PERCENTRANK(array, x, [significance])",
        "parameters": [
          {
            "description": null,
            "name": "array",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "x",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "significance",
            "optional": true,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "PERCENTRANK",
      "version_marker": null,
      "xlcall": {
        "code": "329",
        "symbol": "xlfPercentrank"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/percentrank-function-f1b5836c-9619-4847-9fc9-080ec9024442"
  },
  "try_it": {
    "formula": "=PERCENTRANK({10,20,30,40},15)"
  },
  "url": "https://handbook.dnacalc.com/functions/PERCENTRANK.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "The retained catalogue capture on Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), AMD Ryzen 7 4800H, en-ZA, Workbook Compatibility Version 1 records =PERCENTRANK({37.15,46,54},38.59,6) = 0.081355 (0x3fb4d3ae685db76b). Inputs were entered as the shown formula literal. Raw, saved and reopened views belong to one capture; this is not a comparison between builds.",
      "excel_build": "16.0.20527.20088",
      "observations": [
        {
          "call": "=PERCENTRANK({37.15,46,54},38.59,6)",
          "excel": {
            "bits": "0x3fb4d3ae685db76b",
            "display": "0.081355",
            "kind": "number"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), AMD Ryzen 7 4800H, en-ZA, Workbook Compatibility Version 1"
        }
      ],
      "platform": "Windows 64-bit, AMD Ryzen 7 4800H, en-ZA, Workbook Compatibility Version 1",
      "sources": [
        "https://github.com/DnaCalc/DnaCalc/blob/da3ecc4fb19a3a5529708c311d0e8f05688ac165/crates/calc-func/tests/captures/catalogue/sections/dcj9k_statistics.capture.json"
      ]
    }
  ]
}