Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL2000: COUNTIF Returns Incorrect Value When It Refers to Blank Cells


View products that this article applies to.

Symptoms

The COUNTIF function may return an incorrect, smaller result when counting blank cells.

↑ Back to the top


Cause

This problem occurs when the following conditions are true:
  • The COUNTIF function references a criteria range with blank cells at the right or bottom of the range.

    -and-

  • The function uses "" as the criteria.

    -and-

  • The "used range" of the worksheet, as defined by the last column and last row with data, does not include the blank area of the referred-to criteria range.

↑ Back to the top


Workaround

To work around this problem, type some numbers or text to the right of and below any ranges used in such formulas. Excel then sees the rectangle starting with A1 to the "last cell", as defined by the column and row of that entry, as being used or "dirtied," and the formulas will work as expected.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

↑ Back to the top


More information

If the COUNTIF function returns an incorrect smaller value because of this problem and the workaround is applied, you must cause Excel to completely recalculate before the functions can work correctly. To do this, re-enter the formula or press CTRL+ALT+F9. If data is deleted to create a smaller "used range," you must save the workbook to cause Excel to recognize that there is a new "used range," and then recalculate the workbook.

↑ Back to the top


References

For more information about COUNTIF, click Microsoft Excel Help on the Help menu, type COUNTIF worksheet function in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

↑ Back to the top


Keywords: KB231000, kbpending, kbbug

↑ Back to the top

Article Info
Article ID : 231000
Revision : 3
Created on : 9/25/2003
Published on : 9/25/2003
Exists online : False
Views : 210