GetPivotData Returning Error when Using Reference cell for Date

Crane

New Member
Joined
Aug 27, 2018
Messages
14
Hello,

I need some help, using getpivotdata function for the first time. My pivot looks like this:


[TABLE="width: 500"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Completed[/TD]
[TD]Grand Total[/TD]
[/TR]
[TR]
[TD][TABLE="width: 81"]
<tbody>[TR]
[TD="class: xl802, width: 81"]2018/10/25[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]33[/TD]
[TD]33[/TD]
[/TR]
[TR]
[TD][TABLE="width: 81"]
<tbody>[TR]
[TD="class: xl802, width: 81"]2018/10/26[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]37[/TD]
[TD]37[/TD]
[/TR]
[TR]
[TD][TABLE="width: 81"]
<tbody>[TR]
[TD="class: xl802, width: 81"]2018/10/29[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]36[/TD]
[TD]36[/TD]
[/TR]
</tbody>[/TABLE]

I have a table where I'd like to fetch the data right beside the date when it matches:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Completed[/TD]
[/TR]
[TR]
[TD]2018/10/25[/TD]
[TD]=GETPIVOTDATA("HostName",$A$3,"MigrationStatus","Completed","ScheduleDate","2018/10/25")[/TD]
[/TR]
[TR]
[TD]2018/10/26[/TD]
[TD]=GETPIVOTDATA("HostName",$A$3,"MigrationStatus","Completed","ScheduleDate","2018/10/26")[/TD]
[/TR]
</tbody>[/TABLE]

Using the above formula returns the value without errors. But when I replace the scheduledate with the cell reference, for instance, E2, which is the cell containing the date 2018/10/25, I get the "#Ref!" error. This is the formula is use:

=GETPIVOTDATA("HostName",$A$3,"MigrationStatus","Completed","ScheduleDate",E2)

Please help how to correct this. Thank you.
 
Last edited:

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Judging by the quotes in your working version, the date field is actually text, so you'd need something like this :

=GETPIVOTDATA("HostName",$A$3,"MigrationStatus","Completed","ScheduleDate",TEXT(E2,"yyyy/mm/dd"))
 
Upvote 0
Thank you, Sandy. I tried virtually everything. I read those sources as well until I finally end up here again..none worked :(
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top