CUBEVALUE Function

Excel 2007+

Summary

The CUBEVALUE function retrieves aggregated numerical data from OLAP cubes connected to your Excel workbook. It serves as the primary tool for extracting specific metrics and measures from multidimensional data sources using MDX expressions.

Syntax

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

Parameters

Parameter Type Required Description
connection Text Yes Text string identifying the cube connection in the workbook
member_expression Text No Optional MDX expressions that slice the cube data (repeatable up to 126 times)

Using the CUBEVALUE Function

CUBEVALUE is designed for advanced Excel users working with OLAP data sources. Use it to pull specific aggregated values from cubes by combining measures with dimension members. It's particularly powerful when converting PivotTable formulas or building dynamic cube-based reports.

Common CUBEVALUE Examples

Basic Sales Measure Retrieval

=CUBEVALUE("Sales","[Measures].[Profit]","[Time].[2023]","[Product].[Beverages]")

Returns total profit for Beverages in 2023 from the Sales cube.

Cell-Referenced MDX

=CUBEVALUE($A$1,"[Measures].[Profit]",D$12,$A23)

Uses cell A1 for connection name and other cells for MDX slicers.

Single Measure Default Slicer

=CUBEVALUE("Sales","[Measures].[Store Sales]")

Returns default aggregation for Store Sales measure.

Frequently Asked Questions

Cells temporarily show '#GETTING_DATA…' while fetching values from the cube.

Yes, member_expression can reference a CUBESET-defined set for aggregated results.

Invalid connection name or unavailable OLAP server causes #NAME? errors.

Common Errors and Solutions

#NAME?

Cause: Invalid connection name or OLAP server unavailable

Solution: Verify connection exists in Data > Connections

#N/A

Cause: Invalid MDX syntax or non-existent cube member

Solution: Check MDX expressions and cube structure

#VALUE!

Cause: Invalid tuple elements or hierarchy conflicts

Solution: Ensure tuple members intersect properly

Zero-length strings from NULLs

Cause: OLAP NULL values convert to empty strings

Solution: Wrap with IF(ISTEXT(CUBEVALUE(...)),0,CUBEVALUE(...))

Notes

  • Maximum 126 member_expressions allowed
  • Cell references use underlying MDX, not displayed values
  • NULL values from cubes appear as zero-length strings
  • Works with Power Pivot, Analysis Services, and other OLAP providers

Compatibility

Available in: Excel 2007, Excel 2010, Excel 2013, Excel 2016, Excel 2019, Excel 2021, Excel for Microsoft 365

Not available in: Excel 2003 and earlier

Content last reviewed: December 9, 2025
Update frequency: As needed
Excel versions tested: Excel 2007+