If function returns #REF!, want it to return 0

G

Guest

I am trying to extract and sum data from a pivot table. In order to reduce
the number of formulas I am trying to nest the functions. My formula is as
follows:

=IF(GETPIVOTDATA("Meal",$A$3,"Formula #",175100,"Group
#",Sheet1!C2)="#REF!",0,GETPIVOTDATA("Meal",$A$3,"Formula #",175100,"Group
#",Sheet1!C2))

Sometimes the logic test will result in a #REF! error because the Formula #
175100 is not present at every Group #. Instead of returning the #REF! error
I want it to return a 0. How do I achieve this?
 
G

Guest

try:
=IF(ISERROR(GETPIVOTDATA("Meal",$A$3,"Formula #",175100,"Group
#",Sheet1!C2)),0,GETPIVOTDATA("Meal",$A$3,"Formula #",175100,"Group
#",Sheet1!C2))
 
M

MartinW

Hi Fred, try this

=IF(ISERROR(GETPIVOTDATA("Meal",$A$3,"Formula #",175100,"Group
#",Sheet1!C2)),0,GETPIVOTDATA("Meal",$A$3,"Formula #",175100,"Group
#",Sheet1!C2))

HTH
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top