Fix a #REF Error in Excel GETPIVOTDATA with Dates in WPS Spreadsheets
Question details
The user needs to correct a GETPIVOTDATA formula in WPS Spreadsheets that returns #REF! when it references a date field or date value in a PivotTable.

- Product
- WPS Spreadsheets
- Device & OS
- not provided
- Scenario
- The user is building or editing a PivotTable report and using GETPIVOTDATA to retrieve a value for a date field or specific date item.
- Observed behavior
- The formula returns #REF! because the date field name, PivotTable reference, or date item syntax does not match the PivotTable layout.
Open the workbook in WPS Spreadsheets and confirm the PivotTable name, field names, and the exact date item displayed in the PivotTable before you edit the GETPIVOTDATA formula.
Match field names and PivotTable reference exactly in GETPIVOTDATA
Use this solution when the #REF! error is caused by a mismatched data field, item name, or PivotTable reference.
The #REF! error usually means GETPIVOTDATA cannot find the object or item named in the formula. Clicking the target PivotTable cell lets WPS Spreadsheets build the correct reference automatically.
Click the cell that shows #REF! and inspect the formula bar to identify the current data_field, pivot_table, and field/item arguments.
Click any cell inside the PivotTable, open PivotTable Options from the PivotTable tab or right-click menu, and check that the PivotTable name exactly matches the pivot_table argument in the formula.
Open the PivotTable Fields panel and note the exact spelling of the date field in the Rows, Columns, or Values area, then update the formula arguments to match.
Delete the incorrect formula, type =, click the PivotTable value cell you want, and press Enter so WPS Spreadsheets inserts a valid GETPIVOTDATA reference.

Reference a single date item correctly instead of a date range
Use this solution when the formula attempts to pass an arbitrary date range into GETPIVOTDATA.
Use PivotTable date grouping or a helper cell for flexible date reports
Use this solution when you need values for a month, quarter, year, or a date that changes frequently.
Fix GETPIVOTDATA #REF! Errors in WPS Spreadsheets
WPS Spreadsheets lets you inspect PivotTable names, field items, and date labels, then rebuild the GETPIVOTDATA formula by clicking the target cell so the #REF! error is corrected without extra add-ins.
- 1. Open the workbook: Launch WPS Spreadsheets, click Menu, choose Open, and select the Excel workbook containing the GETPIVOTDATA #REF! error.
- 2. Inspect the PivotTable: Click inside the PivotTable and open the PivotTable Fields panel to note the exact table name, date field names, and date item labels.
- 3. Rebuild the formula: Select the error cell, clear the incorrect argument, click the PivotTable value cell you want, and press Enter to insert a valid GETPIVOTDATA reference.
- 4. Refresh and verify: Go to Data and choose Refresh All, or press F9, then confirm the formula returns the expected date value.
- 5. Save with Excel compatibility: Click Menu, choose Save As, and select Excel Workbook (.xlsx) to keep the corrected formula working in Microsoft Office.

Frequently Asked Questions
Why does GETPIVOTDATA return #REF! when I use a date field?
The usual cause is that the date field name, PivotTable reference, or date item text does not exactly match the PivotTable. In WPS Spreadsheets, click the target PivotTable value cell to generate the correct reference, then compare the arguments with the PivotTable Fields panel.
Can GETPIVOTDATA return a whole date range?
No. GETPIVOTDATA retrieves one item or field value rather than an arbitrary date range. To analyze a date range, group the date field by month, quarter, or year in the PivotTable, or reference individual date items and combine them with other formulas.
How do I find the exact PivotTable name in WPS Spreadsheets?
Click inside the PivotTable, open PivotTable Options from the PivotTable tab or right-click menu, and copy the table name shown there. Use that exact name as the pivot_table argument in GETPIVOTDATA.
How can I create a GETPIVOTDATA formula without typing field names manually?
Select a blank cell, type =, click any value cell inside the PivotTable, and press Enter. WPS Spreadsheets inserts the complete GETPIVOTDATA formula with the correct data_field, pivot_table, and item arguments.
Will the corrected GETPIVOTDATA formula still work in Microsoft Excel?
Yes. WPS Spreadsheets supports Excel .xlsx workbooks and GETPIVOTDATA formula syntax, so the corrected formula remains compatible when you save the file and reopen it in Microsoft Excel.




