Excel =countif wont work on external workbooks that are closed.

Good Afternoon,

I have a summary sheet in a separate workbook with the following function:

=COUNTIF('T:\CenterDocumentSystem\[CDS_Document List.xls]AED'!$E$2:$E$13,"<"&TODAY())

When the workbook specified in the formula is closed, I receive a #VALUE! error.

Is there a way to count the cells in the range and criteria  I'm interested in when the workbook is closed?

If so, please provide the syntax.

Thank you.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
User Sumproduct that won't produce an error if the referenced workbook is closed.
Change your formula to this....

=SUMPRODUCT(--('T:\CenterDocumentSystem\[CDS_Document List.xls]AED'!$E$2:$E$13<TODAY()))

Open in new window

aasikoloAuthor Commented:

Thank you for your quick response.

I took one parameter for granted and failed to mention that the range has blank cells.

The formula you provided works except it is also counting the blank cells in the range.

I am locked out of the worksheet in the formula.

please advise further.

Thank you

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Maybe this....

=SUMPRODUCT(('T:\CenterDocumentSystem\[CDS_Document List.xls]AED'!$E$2:$E$13<TODAY())*('T:\CenterDocumentSystem\[CDS_Document List.xls]AED'!$E$2:$E$13<>""))

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
aasikoloAuthor Commented:
Excellent Solution.  Thank you!
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome aasikolo! Glad I could help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.