I have a project where users must select options from data validation cells. Based on those selections I have formulas that will decide which pivot table to get the data from, and which data to get. The issue I am having is the formulas are getting long because not all of the tables have the same number of rows and column which means that the GETPIVOTDATA formulas don’t have the same number of items.
I would like to do something like this…

=GETPIVOTDATA(“CaseNb”,Sheet1!$A$1,if(Z1=1,”item1, itemA”,””),if(z2=1,”item2,itemB”,””), etc)

So I want to use one GETPIVOTDATA formula whether the data exists or not. However, I haven’t been able to find the correct syntax. Part of the problem is that I would have to use double double quotes like this if(Z1=1,””item1”,”itemA””,””) because the GETPIVOTDATA function requires the items to be surrounded by double quotes, like this =GETPIVOTDATA(“CaseNb”,Sheet1!$A$1,”item1”,” itemA”, …)
Anyone have any idea how to make this work?

Thanks