CUBEMEMBER Function

Excel Functions › Cube

Excel 2007+ Data Model / OLAP

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.


Quick answer: anchor the Displays category in a cell, with a friendly caption:
=CUBEMEMBER("ThisWorkbookDataModel", "[Products].[Category].[Displays]", "Displays")
Reference this cell from CUBEVALUE instead of repeating the member string everywhere.

Syntax

=CUBEMEMBER(connection, member_expression, )
ArgumentDescription
connectionRequiredConnection name as text — "ThisWorkbookDataModel" for Power Pivot.
member_expressionRequiredMDX string for the member, e.g. "[Products].[Category].[Displays]"; an array makes a tuple.
captionOptionalText 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:

B5: =CUBEMEMBER("ThisWorkbookDataModel", "[Products].[Category].[Accessories]")
C5: =CUBEVALUE("ThisWorkbookDataModel", "[Measures].[Total Sales]", $B5)

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

Live demo

Pick a level and item — watch the member expression build itself.

Result:

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

📊
Download the free CUBEMEMBER practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

Why use CUBEMEMBER instead of typing the member string in CUBEVALUE?
Three reasons: the cell shows a readable caption, an invalid member fails loudly in one place, and many CUBEVALUEs referencing one CUBEMEMBER cell run noticeably faster.
What is a tuple in CUBEMEMBER?
Pass an array of member strings — =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?
CUBEMEMBER returns #N/A — which is exactly the point: your report tells you immediately that a category was renamed or removed from the model.
Does CUBEMEMBER work without a Data Model?
No. All cube functions need a Data Model or OLAP connection. Regular ranges and Tables are invisible to them until added to the 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

Related functions: CUBEVALUE · CUBEMEMBER · CUBESET · GETPIVOTDATA · GROUPBY