Solved

Reference to Pivot Table returns #REF

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

My experience with Windows 10 over a one year period and suggestions for smooth operation
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

810 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