How to Fix Excel for the Web COUNTIF #VALUE! Error with SharePoint Workbooks
Question details
The user needs to fix a #VALUE! error that occurs when using COUNTIF formulas to reference external workbooks stored in SharePoint via Excel for the web.

- Product
- Excel for the Web
- Device & OS
- not provided
- Scenario
- Calculating data based on criteria using COUNTIF or COUNTIFS functions that reference another workbook hosted on SharePoint.
- Observed behavior
- The COUNTIF formula returns a #VALUE! error in Excel for the web, despite functioning correctly when both the source and destination workbooks are opened in the desktop version of Excel.
Verify that you have the correct file paths and adequate edit permissions for both the destination workbook and the external SharePoint workbook before altering your formulas.
Use a SUM and IF Array Formula Workaround
Bypass the external link limitations of the COUNTIF function in Excel for the web by combining the SUM and IF functions.
Excel for the web struggles to evaluate conditional external references like COUNTIF and COUNTIFS when the source workbook is not actively open in the same desktop session. Using an array formula forces the web application to evaluate the conditions row by row, avoiding the #VALUE! error.
Click on the cell in your Excel for the web workbook that is currently displaying the #VALUE! error.
Remove the existing COUNTIF formula from the formula bar at the top of the screen.
Type `=SUM(IF([Source.xlsx]Sheet1!$A$1:$A$10="YourCondition", 1, 0))` into the formula bar, replacing the bracketed workbook name, sheet, range, and condition with your actual SharePoint external reference.
Press Enter. Excel for the web natively supports dynamic arrays, so it will automatically process this formula and return the correct count.

Open the Workbooks in Desktop Excel
Since the desktop version of Excel fully supports external workbook references with conditional formulas, opening both files locally resolves the error instantly.
Experience Seamless Spreadsheet Management with WPS Office
If web-based spreadsheet limitations are slowing down your workflow, WPS Office offers a powerful, desktop-grade alternative. It provides robust formula processing and cross-workbook data handling without the typical web environment restrictions.
- 1. Download WPS Office: Visit the official WPS Office website and download the free installer for your operating system.
- 2. Install and launch: Run the installer and follow the on-screen instructions. Once completed, open WPS Spreadsheets.
- 3. Open your workbook: Click 'Open' and select your existing .xlsx file to continue calculating your data seamlessly without web-based formula errors.

Frequently Asked Questions
Why does COUNTIF work in desktop Excel but show #VALUE! in Excel for the web?
Excel for the web has limited background processing capabilities for conditional formulas (like COUNTIF, SUMIF, and COUNTIFS) that reference closed external workbooks. While basic direct cell references function normally, conditional evaluations require the source file to be open in the same desktop instance.
Can I use SUMPRODUCT to fix the external reference error?
Yes. SUMPRODUCT is an excellent alternative array formula that calculates external references properly in Excel for the web. You can format it as `=SUMPRODUCT(--('[Workbook.xlsx]Sheet1'!$A$1:$A$10="Criteria"))` to achieve the same result as COUNTIF.
Will using SUM(IF()) slow down my web workbook?
Array formulas like SUM(IF()) are more resource-intensive than standard COUNTIF functions. If you are applying this workaround to thousands of rows or referencing massive data ranges across multiple SharePoint workbooks, you might notice a slight decrease in calculation speed.




