Go Premium for a chance to win a PS4. Enter to Win

x
Solved

# How do I modify my Count IF formula to return BLANK when referenced worksheet is missing?

Posted on 2011-09-07
Medium Priority
255 Views
Ok, This formula did the job nicely (see attached).
[=COUNTIF(INDIRECT("'"&E\$4&"'!\$D\$5:\$AC\$100"),\$B6)

I now want to modify this formula to return a BLANK (or "") when referenced wksht is missing, instead of #REF!.

Any suggestions?

Gary
LCS-by-Activity-Code-08-2011-EE-.xls
0
Question by:garyrobbins

LVL 6

Accepted Solution

reitzen earned 1800 total points
ID: 36498797
Wrap it in another IF statement

0

LVL 50

Assisted Solution

barry houdini earned 200 total points
ID: 36498875
To avoid repeating the whole formula you can just check whether referring to A1 on that sheet using INDIRECT gives an error, e.g.

=IF(ISERR(INDIRECT("'"&E\$4&"'!A1")),"",COUNTIF(INDIRECT("'"&E\$4&"'!D5:AC100"),\$B6))

regards, barry
0

Author Closing Comment

ID: 36499046
reitzen: Awesome.  I have not yet used the ISERROR function and I now see how simple it is.

Barry, thanks for describing yet another way of addressing the issue -- that may be good for a future application where my formula is long and complicated.

I've split the points - hope you find this fair.

Thanks, again for the prompt response.  You make my job easier knowing you experts are there to help.
Gary
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
###### Suggested Courses
Course of the Month12 days, 22 hours left to enroll