Cubes

CUBEVALUE

Not yet implemented

No catalogue row at this commit. Pivot tables are being implemented in full, and this function with them. How we measure this

Local names in 40 languages
LanguageName in Excel
ArabicCUBEVALUE
BulgarianCUBEVALUE
CzechCUBEVALUE
DanishKUBEVÆRDI
GermanCUBEVALUE
GreekCUBEVALUE
English (Australia)CUBEVALUE
English (United Kingdom)CUBEVALUE
English (United States)CUBEVALUE
SpanishVALORCUBO
EstonianCUBEVALUE
FinnishKUUTIONARVO
FrenchVALEURCUBE
HebrewCUBEVALUE
CroatianCUBEVALUE
HungarianKOCKA.ÉRTÉK
IndonesianCUBEVALUE
ItalianCUBEVALUE
JapaneseCUBEVALUE
KoreanCUBEVALUE
LithuanianCUBEVALUE
LatvianCUBEVALUE
NorwegianCUBEVALUE
DutchKUBUSWAARDE
PolishWARTOŚĆ.MODUŁU
Portuguese (Brazil)CUBEVALUE
Portuguese (Portugal)VALORCUBO
RomanianCUBEVALUE
RussianКУБЗНАЧЕНИЕ
SlovakCUBEVALUE
SlovenianCUBEVALUE
Serbian (Latin)CUBEVALUE
SwedishKUBVÄRDE
ThaiCUBEVALUE
TurkishKÜPDEĞERİ işlevi
UkrainianCUBEVALUE
VietnameseCUBEVALUE
Chinese (Simplified)CUBEVALUE
Chinese (Hong Kong)CUBEVALUE
Chinese (Traditional)CUBEVALUE

Names from Microsoft's support site.

What it does

CUBEVALUE(connection, [member_expression1], [member_expression2], ...)

CUBEVALUE names a point (or a region) of a cube by intersecting a list of member expressions, and asks the cube for the aggregated measure value at that intersection.

The mental model that makes the argument list intelligible: each member_expression is a slicer. Every argument you supply constrains one hierarchy; every hierarchy you leave unconstrained is aggregated over at its default (usually the "All" member). So CUBEVALUE(conn, "[Measures].[Sales]", "[Time].[2024]") means sales, in 2024, summed over everything else — the aggregation is not something CUBEVALUE performs, it is what the cube already holds along the axes you did not pin.

Two consequences follow directly:

  1. Order does not carry meaning; hierarchy membership does. The arguments are a set of constraints, not a positional coordinate vector. Two expressions drawn from the same hierarchy do not narrow — they contradict, and produce an empty intersection.
  2. A missing measure is not an error. Microsoft documents that if no measure appears in any member_expression, the cube's default measure is used. A formula can therefore be perfectly valid, return a number, and be measuring something the author never named.

An argument may also be a CUBESET result rather than a single member. In that case the slice is the whole set and the cube aggregates across it — which is how CUBEVALUE produces subtotals over arbitrary member collections.

Arguments

CUBEVALUE(connection, [member_expression1], [member_expression2], …)

  • connection (required) — text; the name of a connection stored in the workbook. Not a connection string, not a server name. Because it is a lookup key, a wrong name fails as #NAME?.
  • member_expression1, member_expression2, … (optional, repeating) — each is text holding an MDX expression evaluating to a member or a tuple, or a reference to a cell containing a CUBESET or other CUBE function.

The argument position most commonly misunderstood is any member_expression given as a cell reference. Microsoft states the rule plainly: if the referenced cell contains a CUBE function, CUBEVALUE uses that cell's MDX expression, not the value displayed in it. So a grid of CUBEMEMBER headers works as an addressing layer, while a cell containing the plain text "Sales" — which looks identical to a reader — does not.

Omitting all member expressions is legal and asks for the cube's default measure at its default coordinates.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

This example needs an Excel cube connection. OneCalc cannot provide that connection in this preview.

Quirks

Result and edge cases

The published result is normally a number. Two edges deserve naming:

  • Nulls arrive as empty text. Microsoft documents that database null values are converted to zero-length strings, and explicitly recommends guarding dependent formulas with IF and ISTEXT so that arithmetic downstream does not fail. This is the single most consequential edge case on the page: a cell that looks blank is text, not a number, and it will turn A1*2 into #VALUE!. The Handbook's coercion chapter explains why — text that does not read as a number is a named conversion failure, not a silent zero. See coercion and lifting.
  • #GETTING_DATA while the request is outstanding. The cell temporarily displays #GETTING_DATA… before the data arrives. It is one of the extended error codes catalogued in the value universe — a transient placeholder, not a failure.

Errors

As documented by Microsoft on the page linked below:

  • #NAME? — the connection name is not a valid workbook connection; or the OLAP server is not running, not available, or returns an error message. As with the rest of the family, a naming failure and a connectivity failure share one code.
  • #VALUE! — at least one element within the tuple is invalid.
  • #N/A — the member_expression syntax is incorrect; the named member does not exist in the cube; the tuple is invalid because there is no intersection for the specified values (which Microsoft notes "can occur with multiple elements from the same hierarchy"); the set contains at least one member with a different dimension than the others; or the expression refers to a session-scoped calculated member or named set whose PivotTable has been deleted or converted to formulas.

None of these has been observed by the Handbook against a live Excel build. They are reported as documented behaviour, with the source named.

How to implement

Notes for implementers

  • There is no numeric kernel here at all. The interesting work is MDX construction, connection resolution, and asynchronous retrieval; the arithmetic belongs to the server.
  • The null-to-empty-text conversion is a deliberate representational choice with a large blast radius. Any implementation that maps SQL/MDX null to numeric zero will silently produce different totals from Excel, and any implementation that maps it to a genuine blank will behave differently under ISTEXT. The documented behaviour is neither: it is a zero-length string.
  • Argument-position identity (MDX expression versus displayed value for referenced cells) must be resolved before the request is built, which means the evaluator has to be able to see the formula behind a referenced cell, not only its value. That is unusual for a worksheet function and does not fit the ordinary values-only argument-preparation profile described in the call pipeline.
  • Retrieval is asynchronous with a visible intermediate state. Recalculation semantics — when a cell re-requests, what happens to dependents while #GETTING_DATA is showing — are host behaviour, not function semantics.

Rust code

This entry has no Rust implementation yet.

No implementation has been published with a Handbook test suite for this function.

Version differences

No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.

Alternatives

Relationships

CUBEVALUE is the consumer at the end of the family's pipeline; the other six functions produce the coordinates it reads:

  • CUBEMEMBER and CUBERANKEDMEMBER produce single members or tuples.
  • CUBESET produces a set, which CUBEVALUE will aggregate across.
  • CUBEKPIMEMBER produces a KPI component; Microsoft's documented way to use a KPI in a calculation is to pass CUBEKPIMEMBER as a member_expression argument to CUBEVALUE.
  • CUBESETCOUNT and CUBEMEMBERPROPERTY are terminal — they return counts and properties and are not fed back into CUBEVALUE.

The function readers confuse with this one is GETPIVOTDATA, which extracts a value from a PivotTable already rendered on a sheet. CUBEVALUE talks to the cube and needs no PivotTable.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents