CUBESETCOUNT Function
Counts the members in a cube set.
Category
Cube
Available in
Excel 2007+ for Windows, Microsoft 365
Returns
A number
Overview
CUBESETCOUNT tells you how many members a CUBESET contains — how many products sold this month, or how many customers are in a segment.
It's also handy for building lists that stop at the right length.
Syntax
=CUBESETCOUNT(set) Explain
Arguments
| Argument | Required? | What it does |
|---|---|---|
| set | Yes | A cell holding a CUBESET formula, or a CUBESET formula itself. |
Examples
Example 1 — How many products are in the set?
B1 holds a CUBESET of all products.
=CUBESETCOUNT(B1) Explain
Example 2 — List only as many ranks as there are members
Leave the cell empty once the rank runs past the end of the set.
=IF(A3<=CUBESETCOUNT($B$1),CUBERANKEDMEMBER("ThisWorkbookDataModel",$B$1,A3),"") Explain
Common mistakes
- #VALUE! or an error. The argument must be a set (a CUBESET), not a member or a range of values.
Notes
- Cube functions talk to a live Data Model or Analysis Services cube, so they can't run in our practice Sandbox.
- Related functions: CUBEVALUE, CUBEMEMBER, CUBESET, CUBERANKEDMEMBER, CUBESETCOUNT, CUBEMEMBERPROPERTY, CUBEKPIMEMBER, GETPIVOTDATA.

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.