The Excel CUBEMEMBER function returns a member or tuple from a Data Model or OLAP cube — a category, a customer, a month — validating that it exists and giving CUBEVALUE formulas something fast to point at.
Syntax
| Argument | Description | |
|---|---|---|
connection | Required | Connection name as text — "ThisWorkbookDataModel" for Power Pivot. |
member_expression | Required | MDX string for the member, e.g. "[Products].[Category].[Displays]"; an array makes a tuple. |
caption | Optional | Text to display in the cell instead of the raw member name. |
What you need first: cube functions only work against a Power Pivot Data Model (or an external OLAP cube). Add your table to the model — check “Add this data to the Data Model” when inserting a PivotTable, or use the Power Pivot tab — then reference it with the connection name "ThisWorkbookDataModel" and MDX-style member strings like "[Measures].[Total Sales]" or "[Products].[Category].[Displays]".
How to use it
The classic report skeleton: row headers are CUBEMEMBERs, value cells are CUBEVALUEs that reference them:
The shortcut nobody knows: build a Data Model PivotTable, then PivotTable Analyze → OLAP Tools → Convert to Formulas. Excel rewrites the whole pivot as CUBEVALUE/CUBEMEMBER formulas — a free-form report layout that GETPIVOTDATA can’t match.
Try it: interactive demo
Pick a level and item — watch the member expression build itself.
Errors & common pitfalls
#NAME? — bad connection name. The first argument must exactly match a workbook connection; for the built-in Data Model it is "ThisWorkbookDataModel", quotes included.
#N/A — invalid member expression. Table, column, or item names in the MDX string don’t match the model. Check spelling and bracket every level: [Table].[Column].[Item].
“#GETTING_DATA” flashes in cells. Normal — Excel retrieves cube results asynchronously. It resolves when the query finishes.
Performance: hundreds of separate CUBEVALUE calls query the model one by one. Pull shared members into CUBEMEMBER cells once and reference those cells in your CUBEVALUEs.
Practice workbook
Frequently asked questions
Why use CUBEMEMBER instead of typing the member string in CUBEVALUE?
What is a tuple in CUBEMEMBER?
=CUBEMEMBER(conn, {"[Products].[Category].[Video]","[Orders].[Year].[2026]"}) — to pin a combination of members as one object.What happens if the member doesn't exist?
Does CUBEMEMBER work without a Data Model?
Master functions like this in one day
This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class