CUBESETCOUNT Function in Excel: Number of Items in a Set

CUBESETCOUNT Function in Excel: Number of Items in a Set 1
⏱ 1 min readUpdated 13 October 2026

CubeLevel: ExpertAvailable in: Excel 2007+

In this article
  1. Syntax
  2. Examples
  3. Example 1
  4. CUBESETCOUNT in practice
  5. Where you will use it
  6. Worked example
  7. Mistakes people make
  8. Related functions

CUBESETCOUNT counts the items in a set made with CUBESET. Cube functions read from a Power Pivot Data Model (connection “ThisWorkbookDataModel”) or an Analysis Services cube.

Advertisement

Syntax

=CUBESETCOUNT(set)
Argument What it means
connection “ThisWorkbookDataModel” for Power Pivot
… Member, set or KPI expressions in MDX form

Examples

Example 1

=CUBESETCOUNT(set)

Result: (value from your Data Model). See the worked example table below for more cases.

CUBESETCOUNT in practice

Where you will use it

  • Custom report layouts that PivotTables can't do
  • Top-N lists with CUBESET + CUBERANKEDMEMBER
  • Finance packs from a data model

Worked example

WorkbookFormulaResult
Has a Data Model=CUBESETCOUNT(set)(value from your Data Model)

Needs a Power Pivot Data Model, so this example is not calculated here: the result is whatever your model holds.

Mistakes people make

MistakeWhat to do instead
Typos in member namesBuild them with PivotTable > OLAP Tools > Convert to Formulas
No data model#N/A or #NAME?

CUBEVALUE · CUBESET · CUBEMEMBER

📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong

Leave a Reply

Your email address will not be published. Required fields are marked *