=IFERROR(SUM(GETPIVOTDATA("Count of Age",Pivots!O$3,"Case Type",Cases!$B$4,"Age",{13,14,15,16,17})),0)
In my current data set there is nobody age 16 and the formula returns 0 even though there are kids age 13, 14, etc. The formula works fine if I take 16 out of the condition array. But the next time I run it there may be somebody age 16 and maybe there won't be anybody age 17. So how do I change the formula so it ignores missing values? I'm assuming it has something to do with the IFERROR function but not sure how to fix it. The only guess I have is to do a series of single age lookups like this:
=IFERROR(GETPIVOTDATA("Count of Age",Pivots!O$3,"Case Type",Cases!$B$4,"Age",13),0)+IFERROR(GETPIVOTDATA("Count of Age",Pivots!O$3,"Case Type",Cases!$B$4,"Age",14),0)
Is there any easier way?
In my current data set there is nobody age 16 and the formula returns 0 even though there are kids age 13, 14, etc. The formula works fine if I take 16 out of the condition array. But the next time I run it there may be somebody age 16 and maybe there won't be anybody age 17. So how do I change the formula so it ignores missing values? I'm assuming it has something to do with the IFERROR function but not sure how to fix it. The only guess I have is to do a series of single age lookups like this:
=IFERROR(GETPIVOTDATA("Count of Age",Pivots!O$3,"Case Type",Cases!$B$4,"Age",13),0)+IFERROR(GETPIVOTDATA("Count of Age",Pivots!O$3,"Case Type",Cases!$B$4,"Age",14),0)
Is there any easier way?
Last edited: