How to Display a Selected Slicer Value in an Excel Cell
Question details
The user wants to extract the currently selected value from an Excel slicer (used to filter an ordinary table or Power Query output) and display it inside a specific worksheet cell without relying on VBA macros.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Filtering an ordinary table using slicers and attempting to display the selected Driver and Date values in a separate cell. The user tried using the CUBERANKEDMEMBER formula, but it returned an N/A error.
- Observed behavior
- CUBE functions return an N/A error because the slicer is attached to an ordinary standard table rather than being properly connected to an OLAP Data Model and PivotTable.
Ensure your Excel workbook is saved. Note that standard table slicers cannot be directly referenced by native formulas; you will need to adapt your data structure to use the Data Model or rely on formulas that read filtered visible rows.
Convert to a Data Model and Use CUBE Functions
By converting your data into the Excel Data Model and creating a PivotTable, you enable CUBE functions to directly read the slicer selections without needing VBA.
CUBE functions such as CUBERANKEDMEMBER and CUBESET natively interact with OLAP data models and PivotTable-connected slicers. If you are filtering a standard table, these functions will fail. Loading your data into the Data Model bridges this gap.
Select your Power Query output or standard table. Go to the 'Insert' tab and click 'PivotTable'. In the dialog box, make sure to check 'Add this data to the Data Model', then click OK.
Click anywhere inside your new PivotTable. Navigate to the 'PivotTable Analyze' tab and click 'Insert Slicer'. Choose the field you want to filter (e.g., Driver) and click OK.
Select the newly inserted slicer, go to the 'Slicer' tab on the ribbon, and click 'Slicer Settings'. Note the exact 'Name to use in formulas' (for example, Slicer_Driver).
Select the target cell where you want to display the value (e.g., cell A1). Enter the formula: =CUBERANKEDMEMBER("ThisWorkbookDataModel", CUBESET("ThisWorkbookDataModel", Slicer_Driver), 1). Press Enter to display the currently selected slicer value.
Extract Values from Filtered Table Rows Using INDEX and AGGREGATE
If you prefer not to use the Data Model, you can use lookup formulas to read the first visible row remaining after the table slicer applies its filter.
Manage Spreadsheets Effortlessly with WPS Office
If you're dealing with advanced spreadsheet data or looking for a lightweight, feature-rich alternative to Microsoft Excel, WPS Office is an excellent choice. It provides robust tools for data analysis, filtering, and seamless compatibility with standard Excel files.
- 1. Download and Install: Download WPS Office for free from the official website and install it on your device.
- 2. Open Your Spreadsheet: Launch WPS Spreadsheets and click 'Open' to seamlessly load your existing Excel workbooks.
- 3. Analyze Data: Utilize the 'Data' and 'Insert' tabs to manage tables, apply filters, and build standard PivotTables without compatibility issues.

Frequently Asked Questions
Why does CUBERANKEDMEMBER return an N/A error with my slicer?
CUBE functions are designed exclusively for OLAP databases and the Excel Data Model. If your slicer is connected to a standard worksheet table instead of a PivotTable that relies on the Data Model, the function cannot read it and returns an N/A error.
Can I display a selected slicer value using VBA?
Yes. With VBA macros, you can loop through the SlicerItems collection within a specific SlicerCache, check which items have their 'Selected' property set to True, and output the item names directly to a worksheet cell.
How do I show multiple selected slicer items in one cell without VBA?
If your data is part of the Data Model, you can combine the CUBESET and CUBERANKEDMEMBER functions inside a TEXTJOIN array formula. This allows Excel to loop through all ranks of the selected items and concatenate them into a single comma-separated string.
Is there a direct formula to read standard table slicers natively?
No, standard table slicers do not have native formulas that read their selection states directly. You must either use the Data Model and PivotTable workaround, utilize VBA, or read the first visible row of the filtered table using INDEX and AGGREGATE functions.




