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

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

schielrn

Well-known Member
Joined
Apr 4, 2007
Messages
6,941
Welcome to the Board!

You can do something to the fact like:

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

Hope that helps.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,853
Messages
5,833,985
Members
430,249
Latest member
Muka

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
Top