Solved

Reference to Pivot Table returns #REF

Posted on 2013-12-17
2
356 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

948 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now