The Excel CUBERANKEDMEMBER function returns the nth item of a CUBESET — rank 1, rank 2, rank 3 — which makes living top-10 leaderboards that re-rank themselves whenever the Data Model refreshes.
ROW()-offset as the rank to spill out the whole leaderboard.
Syntax
| Argument | Description | |
|---|---|---|
connection | Required | "ThisWorkbookDataModel" for Power Pivot. |
set_expression | Required | A CUBESET cell reference (usual) or a literal set expression. |
rank | Required | 1 = first item, 2 = second… use ROW() arithmetic to fill a column. |
caption | Optional | Display text override. |
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
Full leaderboard pattern (set sorted descending by sales in B2):
Try it: interactive demo
Drag the rank and watch which customer the formula returns from a sample sorted set.
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
How do I make the rank increase as I copy down?
ROW()-4 gives 1, 2, 3… as you copy down.My leaderboard isn't sorted by value — why?
What happens when rank exceeds the set size?
Can I get the value, not the name?
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