Error Handling in Excel

kleinsim

New Member
Joined
Jun 20, 2008
Messages
4
I am comparing matching entries in two pivot tables using the GETPIVOTDATA command. I'd rather not create another pivot table for what I am doing but I just found that I have several entries in one pivot table that do not appear in the other. As you know when I try to look up, say, the corresponding value for apples in a pivot table that only has entries for peaches, plums, and strawberries I get a #REF! error. I was wondering whether there is a way to stop such errors from occuring by checking whether it will occur before it is executed in a style such as this: if(B2=0,"Div by 0",B3/B2).

Thanks bunches

kleinsi
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Welcome to the Board!

You can do something to the fact like:

=if(iserror(B2),"Is error","Not error")

Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,215,290
Messages
6,124,091
Members
449,142
Latest member
championbowler

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