Ignore #REF errors in GETPIVOTDATA array. Named range possible?

Groves22

New Member
Joined
Dec 5, 2012
Messages
16
Hey all,

I'm working with several pivot tables and using GETPIVOTDATA to pull my information into my exhibit.

Currently my formula looks like this: (and works just fine)
Code:
=IFERROR(IF(eAGT="All",GETPIVOTDATA("PolNumber",Q!$B$3,"State",xState),GETPIVOTDATA("PolNumber",Q!$B$3,"State",xState,"GenAgt",eAGT)),0)

My updated formula using an array for GP1:
Code:
{=IFERROR(IF(eAGT="All",GETPIVOTDATA("PolNumber",Q!$B$3,"State",xState),IF(eAGT="GP1",SUM(GETPIVOTDATA("PolNumber",Q!$B$3,"State",xState,"GenAgt",{"001";"004";"B34"})),GETPIVOTDATA("PolNumber",Q!$B$3,"State",xState,"GenAgt",eAGT))),0)}

If 001, 004, and B34 are all in the data for the month, no problems. If any of them are absent, they return a #REF error and a 0 for the final count. The AGT can change month to month so I can't easily have a static list in the array. Which brings another question... am I able to use a dynamic named range in the GETPIVOTDATA function? That's something else I tried that didn't work.

Thanks!
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,215,237
Messages
6,123,803
Members
449,127
Latest member
Cyko

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