Practice free

CUBESETCOUNT function

CUBESETCOUNT counts how many members a cube set holds and returns that number. It takes a set, not a connection name, and needs an OLAP cube or Data Model connection.

Example

=CUBESETCOUNT(A1)

Expected result: n/a Not yet checked in desktop Excel

Syntax

CUBESETCOUNT(set)

set (required)
A set, usually a cell containing a CUBESET formula.

Returns: The number of items in the set.

What Excel actually returns

Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.

FormulaExcel showsCase
=CUBESETCOUNT("abc") #N/A Text that is not a set
=CUBESETCOUNT(5) #N/A Number
=CUBESETCOUNT(CUBESET("NoSuchConnection","[Product].[All].Children")) #N/A CUBESET on missing connection
=CUBESETCOUNT(Data!D1) #N/A Blank cell
=CUBESETCOUNT(Data!E4) #DIV/0! Error input

The Data sheet these formulas read

A cell that starts with = holds that formula.

Watch out for

  • Takes a set, not a connection name.

Where it works

Excel
CUBESETCOUNT is in every version of Excel from 2007 on. Needs an OLAP cube or Data Model connection; Windows desktop Excel only for most uses.
Google Sheets
No direct equivalent. No cube support in Google Sheets.

Part of Cube functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .