How to Fix Excel CUBEVALUE and CUBEMEMBER Cell Reference Errors
Question details
Users need to use dynamic cell references for criteria (like a year) in CUBEVALUE and CUBEMEMBER formulas, but run into formula errors when referencing cells.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Building dynamic reports querying an Excel Data Model where the member parameters in CUBE functions need to be driven by cell values on the sheet.
- Observed behavior
- When a hard-coded value is replaced with a cell reference inside an array constant, the formula breaks, returning a formula parsing error or an #N/A error.
Verify that your workbook contains a valid Data Model and confirm the exact MDX spelling of your cube, dimension, and hierarchy names before modifying the formulas.
Use Separate CUBEMEMBER Functions with Concatenation
Avoid array constants and construct each filter expression using an individual CUBEMEMBER function, securely concatenating the cell reference into the MDX string.
When attempting to insert a dynamic cell reference (e.g., A1) into a cube member string, using array constants with curly brackets {} causes parsing errors because Excel does not evaluate formulas or concatenation operations inside an array constant.
To resolve this, break the array out into separate CUBEMEMBER functions. This forces Excel to evaluate the concatenated cell reference properly before sending the query to the Data Model.
Locate the cell containing the dynamic value you wish to filter by (for example, cell A1 containing the year 2017).
Wrap the dimension string in quotation marks, append an ampersand, and insert the cell reference. For example: "[Table].[Year].&[" & $A$1 & "]"
Place this concatenated string inside its own CUBEMEMBER function. Example: CUBEMEMBER("ThisWorkbookDataModel", "[Table].[Year].&[" & $A$1 & "]")
Pass all individual CUBEMEMBER functions as separate arguments into your main CUBEVALUE function instead of grouping them inside curly brackets {}.

Try WPS Office for Efficient Data Analysis
While CUBE formulas are specific to Microsoft Excel's Data Model, WPS Office provides a free, lightweight, and highly compatible alternative for everyday spreadsheet tasks, complex data processing, and advanced visualization.
- 1. Download WPS Office: Visit the official WPS website to download and install the free WPS Office suite on your computer.
- 2. Open WPS Spreadsheet: Launch the application and select 'Spreadsheet' from the home screen.
- 3. Import existing files: Open your existing .xlsx workbooks directly in WPS Office to continue your data analysis without formatting loss.

Frequently Asked Questions
Why do I get an #N/A error when using cell references in CUBEVALUE?
An #N/A error generally occurs because the evaluated text string does not match an exact member in the data model. This often happens if there's an extra space in the concatenation or if the cell reference changes the data type.
Can I use array constants with dynamic cell references in Excel?
No. Excel does not evaluate functions, variables, or string concatenations (like & A1 &) inside an array constant (enclosed in {}). You must separate them into individual function arguments.
What does 'ThisWorkbookDataModel' mean in the formula?
It is the default connection name Excel utilizes when referencing data that has been added to the workbook's internal Power Pivot Data Model.




