{
  "category": "Cubes",
  "display_name": "CUBESETCOUNT",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.CUBESETCOUNT",
  "implementation_state": {
    "answer_bank": null,
    "detail": "No catalogue row at this commit. Pivot tables are being implemented in full, and this function with them.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": false,
    "state": "refuses",
    "state_label": "Refuses or not implemented",
    "summary": "Not yet implemented",
    "workbook_corpus": null
  },
  "implementations": [],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.CUBESETCOUNT.json",
  "name": "CUBESETCOUNT",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n### Relationships\n\n\n- **`CUBESET`** — the only sensible source of the `set` argument. `CUBESETCOUNT` has no\n  independent existence.\n- **`CUBERANKEDMEMBER`** — the companion accessor. `CUBESETCOUNT` gives the upper bound,\n  `CUBERANKEDMEMBER` retrieves the item at each rank. The pair is the family's iteration idiom.\n- **`COUNT` / `COUNTA` / `ROWS`** — the functions readers reach for by analogy, and none of\n  them apply. A `CUBESET` result is one cell holding a handle, so `ROWS` and `COUNTA` see one\n  cell regardless of how many members the set contains.\n\n\n",
    "how-to-implement": "\n### Notes for implementers\n\n\n- The absent connection argument means the set value must carry its own connection binding.\n  Any implementation modelling a `CUBESET` result as plain text will be unable to implement\n  `CUBESETCOUNT` at all.\n- The `#GETTING_DATA` remark implies the count may be a server round trip rather than a local\n  property. An implementation is not free to assume the set is already materialized.\n- Because the documentation lists no errors, an implementation targeting Excel compatibility\n  here has nothing to copy and must be driven by observation.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nA number: the item count.\n\nWhile the request is outstanding the cell displays `#GETTING_DATA…`, which Microsoft documents\nfor this function as for the rest of the family — a transient extended-family placeholder\ncatalogued in [the value universe](../model/01-value-universe.md), not a failure. Its presence\nhere is itself informative: even a \"pure count\" can require a round trip, because the set may\nnot have been enumerated on the server yet.\n\nWhether an empty set yields `0` or an error is not stated in the documentation, and the\nHandbook does not know. It is listed below as a probe.\n\n\n\n### Errors\n\n\nMicrosoft's page for `CUBESETCOUNT` documents no error conditions of its own — unusually for\nthis family, it lists only the `#GETTING_DATA` remark. That is a real gap in the documentation\nrather than a claim that the function cannot fail: an invalid `set` argument, a dead connection\nbehind the referenced `CUBESET`, and an errored `CUBESET` cell must all produce *something*,\nand the Handbook cannot say what from the source.\n\nWhat can be said honestly: an error value arriving in the `set` argument would, under the\nHandbook's shared coercion discipline, be expected to propagate — coercion never silently\ndiscards a worksheet error (see [coercion and lifting](../model/02-coercion-and-lifting.md)).\nThat is the general engine rule, not an observation of this function.\n\n\n",
    "sources": "- Microsoft, \"CUBESETCOUNT function\" —\n  <https://support.microsoft.com/en-us/office/cubesetcount-function-c4c2a438-c1ff-4061-80fe-982f2d705286>\n  (syntax, the single `set` argument and its wording, the `#GETTING_DATA` remark, and the\n  absence of any documented error condition).\n- Microsoft, \"CUBESET function\" —\n  <https://support.microsoft.com/en-us/office/cubeset-function-5b2146bd-62d6-4d04-9d8f-670e993ee1d9>\n  (what the `set` argument must be produced by).\n- Handbook `data/presence/FUNC.CUBESETCOUNT.json` — no implementation module, no dispatch entry.\n- Handbook `content/model/01-value-universe.md` and `content/model/02-coercion-and-lifting.md`\n  — the extended error-code family and the error-propagation discipline invoked above.\n\n",
    "version-differences": "No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.",
    "what-it-does": "\n`CUBESETCOUNT` is the smallest function in the cube family and the only one that is purely an\naccessor: it reports the cardinality of a set that `CUBESET` has already built.\n\n\nThe number of items in a set. Not the number of *distinct members* across all hierarchies, and\nnot a measure — the count of top-level items the set contains, where each item may itself be a\ntuple.\n\nIt is the natural loop bound for the `CUBERANKEDMEMBER` pattern: build a set once with\n`CUBESET`, ask `CUBESETCOUNT` how many items it has, then index into it with\n`CUBERANKEDMEMBER(…, 1)`, `(…, 2)`, and so on. Without it, a workbook has no way to know how\nfar a server-side set extends, because the members never come to the client.\n\nNote what it does not take: no `connection` argument. `CUBESETCOUNT` is the only function in\nthe family with no connection parameter, because the set handle it is given already carries its\nown connection. That absence is the clearest evidence that a `CUBESET` cell is a handle to\nserver-side state rather than a piece of text.\n\n\n\n### Arguments\n\n\n`CUBESETCOUNT(set)`\n\n- **`set`** (required) — Microsoft describes it as \"a text string of a Microsoft Excel\n  expression that evaluates to a set defined by the CUBESET function\". In practice that is\n  either a `CUBESET(…)` call written inline or, far more commonly, a reference to a cell\n  containing one.\n\nThe misunderstanding to guard against: this argument is not an ordinary text value. A cell\ncontaining the *literal text* of a set expression is not a set; a cell containing a `CUBESET`\nformula is. The two look identical to a reader, and the documentation's phrase \"a text string\nof a Microsoft Excel expression\" invites exactly that confusion. The same identity-versus-display\ndistinction runs through the whole family — see [`CUBEMEMBER`](FUNC.CUBEMEMBER.md).\n\n\n"
  },
  "signature": {
    "display": "CUBESETCOUNT(set)",
    "parameters": [
      {
        "description": null,
        "name": "set",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "not_implemented",
        "reason": "No catalogue row at this commit. Pivot tables are being implemented in full, and this function with them."
      },
      "arity": {
        "max": 1,
        "min": 1
      },
      "category": "Cubes",
      "classification": {},
      "descriptions": {
        "long": null,
        "short": "How many items a cube set holds",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the number of items in a set.",
        "microsoft_url": "https://support.microsoft.com/en-us/office/cubesetcount-function-c4c2a438-c1ff-4061-80fe-982f2d705286"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "bg-BG",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "cs-CZ",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "da-DK",
          "name": "KUBESÆT.ANTAL"
        },
        {
          "locale": "de-DE",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "el-GR",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "en-AU",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "en-GB",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "en-US",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "es-ES",
          "name": "RECUENTOCONJUNTOCUBO"
        },
        {
          "locale": "et-EE",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "fi-FI",
          "name": "KUUTIOJOUKKOJENMÄÄRÄ"
        },
        {
          "locale": "fr-FR",
          "name": "NBJEUCUBE*"
        },
        {
          "locale": "he-IL",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "hr-HR",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "hu-HU",
          "name": "KOCKA.HALM.DB"
        },
        {
          "locale": "id-ID",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "it-IT",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "ja-JP",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "ko-KR",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "lt-LT",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "lv-LV",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "nb-NO",
          "name": "KUBESETTANTALL"
        },
        {
          "locale": "nl-NL",
          "name": "KUBUSSETAANTAL"
        },
        {
          "locale": "pl-PL",
          "name": "LICZNIK.MODUŁÓW.ZESTAWU"
        },
        {
          "locale": "pt-BR",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "pt-PT",
          "name": "CONTARCONJUNTOCUBO"
        },
        {
          "locale": "ro-RO",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "ru-RU",
          "name": "КУБЧИСЛОЭЛМНОЖ"
        },
        {
          "locale": "sk-SK",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "sl-SI",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "sv-SE",
          "name": "KUBUPPSÄTTNINGANTAL"
        },
        {
          "locale": "th-TH",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "tr-TR",
          "name": "KÜPKÜMESAYISI işlevi"
        },
        {
          "locale": "uk-UA",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "vi-VN",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "zh-CN",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "zh-HK",
          "name": "CUBESETCOUNT"
        },
        {
          "locale": "zh-TW",
          "name": "CUBESETCOUNT"
        }
      ],
      "signature": {
        "display": "CUBESETCOUNT(set)",
        "parameters": [
          {
            "description": null,
            "name": "set",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "CUBESETCOUNT",
      "version_marker": null,
      "xlcall": {
        "code": "479",
        "symbol": "xlfCubesetcount"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/cubesetcount-function-c4c2a438-c1ff-4061-80fe-982f2d705286"
  },
  "try_it": {
    "formula": "=CUBESETCOUNT(B2)",
    "inputs": {
      "B2": 1
    },
    "note": "This example needs an Excel cube connection. OneCalc cannot provide that connection in this preview.",
    "preview_status": "refused"
  },
  "url": "https://handbook.dnacalc.com/functions/CUBESETCOUNT.html",
  "variants": [],
  "versions": []
}