CUBEVALUE function
CUBEVALUE returns an aggregated value from a cube or the Data Model for the members you choose, such as total sales for one year and region. Hundreds of these in one workbook can make it slow.
Example
=CUBEVALUE("ThisWorkbookDataModel","[Measures].[Total Sales]","[Date].[Year].&[2024]")
Expected result: n/a Not yet checked in desktop Excel
Syntax
CUBEVALUE(connection, [member_expression1], [member_expression2], ...)
Arguments in [square brackets] are optional.
-
connection(required) - Name of the cube connection.
-
member_expression1(optional) - A measure, member, or tuple narrowing the value.
-
member_expression2(optional) - More members, each filtering further.
Returns: The aggregated value from the cube for the given members.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=CUBEVALUE("NoSuchConnection","[Measures].[Sales]") | #N/A | Unknown connection name |
=CUBEVALUE("ThisWorkbookDataModel","[Measures].[Sales]") | #N/A | ThisWorkbookDataModel without a model |
=CUBEVALUE("","[Measures].[Sales]") | #N/A | Empty connection string |
=CUBEVALUE(1,"[Measures].[Sales]") | #N/A | Connection is a number |
=CUBEVALUE("NoSuchConnection") | #N/A | Connection only |
=CUBEVALUE(Data!D1,"[Measures].[Sales]") | #N/A | Connection from blank cell |
The Data sheet these formulas read
A cell that starts with = holds that formula.
D
1
Data
Watch out for
- Members from the same dimension conflict and give #VALUE!.
- Hundreds of these can make a workbook slow.
Where it works
- Excel
- CUBEVALUE 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 .