indirect question

mcarter973

Board Regular
Joined
Mar 24, 2002
Messages
83
i'm using INDIRECT w/ each tab a month (Jan...Dec). if the sheet doesn't exist, i get a #REF error message - is there a way to return zero (or blank) if the sheet doesn't exist?

thanks
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Would something like this help:

=if(iserror(indirect(blah blah blah)),"",indirect(blah blah blah))
 
Upvote 0
Just as an addition:

you should avoid using iserror to mask 'unwanted' error messages. Why? "cos it will mask all errors. Using it ou would not notice the following:

=IF(ISERROR(INECT(E22)),"",INDIRECT(E22))

because iserror will mask the expected #NAME? error you'd get here. In general, you should use the specific function:

=IF(ISREF(INDIRECT(E22)),"",INDIRECT(E22))

or error.type value:

=IF(ERROR.TYPE(INDIRECT(E22))=4,"",INDIRECT(E22))

Paddy
 
Upvote 0

Forum statistics

Threads
1,214,874
Messages
6,122,034
Members
449,061
Latest member
TheRealJoaquin

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