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

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

phantom1975

MrExcel MVP
Joined
Jun 3, 2002
Messages
3,962
Would something like this help:

=if(iserror(indirect(blah blah blah)),"",indirect(blah blah blah))
 

PaddyD

MrExcel MVP
Joined
May 1, 2002
Messages
14,234
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
 

Forum statistics

Threads
1,143,921
Messages
5,721,549
Members
422,369
Latest member
redinator

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