Solved

Reference to Pivot Table returns #REF

Posted on 2013-12-17
2
398 Views
Last Modified: 2013-12-18
I have Excel worksheets connected to Access tables, which create Pivot Tables.  The results are grouped by month, and I have a cover sheet which summarizes the data from multiple worksheets.

There is a summary line for each month, but if the pivot table does not have a line for that month, the it returns #REF, and messes up any calculation using that cell.

For example: if there is no month 10 (October) =GETPIVOTDATA("ChargeAmount",'camper charges'!$A$1,"ChargeDate",10) returns #REF

Is there anyway to use an IF THEN, so it returns 0 if row 10 does not exist?
0
Comment
Question by:pjfromny
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 17

Accepted Solution

by:
andrewssd3 earned 500 total points
ID: 39725886
If you have Excel 2007 or later you can say
=IFERROR(GETPIVOTDATA("ChargeAmount",'camper charges'!$A$1,"ChargeDate",10),0)

Open in new window

If you are on 2003 or before you need to use the longer-winded
=IF(ISERROR(GETPIVOTDATA("ChargeAmount",'camper charges'!$A$1,"ChargeDate",10)),0,GETPIVOTDATA("ChargeAmount",'camper charges'!$A$1,"ChargeDate",10))

Open in new window

0
 

Author Closing Comment

by:pjfromny
ID: 39726828
Just what I needed!  Thanks!
0

Featured Post

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question