{
  "category": "Compatibility",
  "display_name": "QUARTILE",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.QUARTILE",
  "implementation_state": {
    "answer_bank": null,
    "detail": "Recorded: 5 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 5 recorded answers",
    "workbook_corpus": {
      "cells": 5,
      "matched": 5
    }
  },
  "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#L305-L305"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/statistics::list",
        "catalogue/statistics::quartile",
        "ported/percentile_common::percentile_inc_kernel",
        "ported/percentile_common::percentile_exc_kernel",
        "ported/percentile_common::interpolate_sorted"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/statistics.rs#L305-L305",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 5 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.QUARTILE.json",
  "name": "QUARTILE",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n[QUARTILE.INC](FUNC.QUARTILE.INC.md) names this convention; [QUARTILE.EXC](FUNC.QUARTILE.EXC.md) uses the exclusive convention; [PERCENTILE.INC](FUNC.PERCENTILE.INC.md) accepts arbitrary fractions.\n\n\n",
    "how-to-implement": "\nCollect the numeric observations, truncate and validate the selector `q`, then call the inclusive percentile helper with `k=q/4`. Sorting and interpolation follow [PERCENTILE](FUNC.PERCENTILE.md#how-to-implement).\n\nFor `q=1,n=4`, the one-based position is `1+(4-1)/4=1.75`; interpolate `10+0.75*(20-10)=17.5`. For `q=3`, the position is `3.25`, giving `30+0.25*(40-30)=32.5`. Selectors zero and four select endpoints without interpolation. A single numeric observation supplies all five inclusive quartiles.\n\nThis definition is a specific percentile convention. Splitting the sample into halves, dropping repeated observations or changing how an odd middle observation joins those halves implements another convention. The current helper’s rank and interpolation arithmetic still need their own numerical controls before a whole-domain Excel claim.\n\n\n",
    "quirks": "\nThe selector is truncated to an integer. Empty numeric data or a selector outside zero through four after the current truncation gives `#NUM!`; a nonnumeric selector gives `#VALUE!`. Referenced text, logical values and blanks do not extend the numeric sample; zeros and repeated numbers do.\n\nThe array need not already be sorted. The selector is a quartile number, not a percentile fraction: pass one for the lower quartile, rather than `0.25`. The exclusive quartile convention uses different positions and can reject a requested quartile when the sample is too small.\n\n\n",
    "sources": "\n- [Microsoft: QUARTILE function](https://support.microsoft.com/en-us/excel/functions/quartile-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/percentile_common.rs); implementation steps and the limits identified in the text.\n\n",
    "try-it": "\n`=QUARTILE({10,20,30,40},1)` returns `17.5`, the inclusive 25th percentile. The five selectors give:\n\n| Selector | Meaning | Value for these observations |\n|---:|---|---:|\n| 0 | minimum | 10 |\n| 1 | lower quartile | 17.5 |\n| 2 | median | 25 |\n| 3 | upper quartile | 32.5 |\n| 4 | maximum | 40 |\n\nUsing medians of the lower and upper halves would give different lower and upper quartiles for this example.\n\n\n",
    "version-differences": "\nNo 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\n\n",
    "what-it-does": "\n`QUARTILE(array,quart)` is the compatibility function for inclusive quartiles. The selector zero means minimum, one lower quartile, two median, three upper quartile, and four maximum.\n\n\n"
  },
  "signature": {
    "display": "QUARTILE(array, quart)",
    "parameters": [
      {
        "description": null,
        "name": "array",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "quart",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 2,
        "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": "A quartile of a data set, inclusive (older form)",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the quartile of a data set",
        "microsoft_url": "https://support.microsoft.com/en-us/office/quartile-function-93cf8f62-60cd-4fdb-8a92-8451041e1a2a"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "QUARTILE"
        },
        {
          "locale": "bg-BG",
          "name": "QUARTILE"
        },
        {
          "locale": "cs-CZ",
          "name": "QUARTIL"
        },
        {
          "locale": "da-DK",
          "name": "KVARTIL"
        },
        {
          "locale": "de-DE",
          "name": "QUARTILE"
        },
        {
          "locale": "el-GR",
          "name": "QUARTILE"
        },
        {
          "locale": "en-AU",
          "name": "QUARTILE"
        },
        {
          "locale": "en-GB",
          "name": "QUARTILE"
        },
        {
          "locale": "en-US",
          "name": "QUARTILE"
        },
        {
          "locale": "es-ES",
          "name": "CUARTIL"
        },
        {
          "locale": "et-EE",
          "name": "QUARTILE"
        },
        {
          "locale": "fi-FI",
          "name": "NELJÄNNES"
        },
        {
          "locale": "fr-FR",
          "name": "QUARTILE*"
        },
        {
          "locale": "he-IL",
          "name": "QUARTILE"
        },
        {
          "locale": "hr-HR",
          "name": "QUARTILE"
        },
        {
          "locale": "hu-HU",
          "name": "KVARTILIS"
        },
        {
          "locale": "id-ID",
          "name": "QUARTILE"
        },
        {
          "locale": "it-IT",
          "name": "QUARTILE"
        },
        {
          "locale": "ja-JP",
          "name": "QUARTILE"
        },
        {
          "locale": "ko-KR",
          "name": "QUARTILE"
        },
        {
          "locale": "lt-LT",
          "name": "QUARTILE"
        },
        {
          "locale": "lv-LV",
          "name": "QUARTILE"
        },
        {
          "locale": "nb-NO",
          "name": "KVARTIL"
        },
        {
          "locale": "nl-NL",
          "name": "KWARTIEL"
        },
        {
          "locale": "pl-PL",
          "name": "KWARTYL"
        },
        {
          "locale": "pt-BR",
          "name": "QUARTILE"
        },
        {
          "locale": "pt-PT",
          "name": "QUARTIL"
        },
        {
          "locale": "ro-RO",
          "name": "QUARTILE"
        },
        {
          "locale": "ru-RU",
          "name": "КВАРТИЛЬ"
        },
        {
          "locale": "sk-SK",
          "name": "QUARTILE"
        },
        {
          "locale": "sl-SI",
          "name": "QUARTILE"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "QUARTILE"
        },
        {
          "locale": "sv-SE",
          "name": "KVARTIL"
        },
        {
          "locale": "th-TH",
          "name": "QUARTILE"
        },
        {
          "locale": "tr-TR",
          "name": "DÖRTTEBİRLİK işlevi"
        },
        {
          "locale": "uk-UA",
          "name": "QUARTILE"
        },
        {
          "locale": "vi-VN",
          "name": "QUARTILE"
        },
        {
          "locale": "zh-CN",
          "name": "QUARTILE"
        },
        {
          "locale": "zh-HK",
          "name": "QUARTILE"
        },
        {
          "locale": "zh-TW",
          "name": "QUARTILE"
        }
      ],
      "signature": {
        "display": "QUARTILE(array, quart)",
        "parameters": [
          {
            "description": null,
            "name": "array",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "quart",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "QUARTILE",
      "version_marker": null,
      "xlcall": {
        "code": "327",
        "symbol": "xlfQuartile"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/quartile-function-93cf8f62-60cd-4fdb-8a92-8451041e1a2a"
  },
  "try_it": {
    "formula": "=QUARTILE({10,20,30,40},1)"
  },
  "url": "https://handbook.dnacalc.com/functions/QUARTILE.html",
  "variants": [],
  "versions": []
}