Software⏱️ 3 min read📅 2026-06-15

How to Fix: Error using Count If

Error using countif to check if values are present in an array.

Quick Answer: The issue is with the index-match formula, which returns a single value instead of an array. Use INDEX-MATCH with multiple criteria or use the COUNTIF function correctly by specifying the range and criteria separately.

The error 'Error using Count If' affects users who are trying to use the COUNTIF function in Excel to check if values exist in a range. This issue can be frustrating for those who rely on this function to filter data, but fortunately, it has a simple solution.

This error can occur when using the COUNTIF function with an index-match operation, as seen in your example. The problem lies in the way Excel handles the comparison of values between two sheets.

💡 Why You Are Getting This Error

  • The primary reason for this error is that the COUNTIF function returns a number, not a logical value (TRUE or FALSE). When using an index-match operation with COUNTIF, Excel interprets the result as a number, rather than a logical value. This causes the formula to return incorrect results.
  • Another possible cause of this error is when the data range in the second sheet ('Plotted Points'!A:A) contains empty cells. If these cells are not explicitly set to a specific value (like TRUE or FALSE), Excel may interpret them as blank and affect the result of the COUNTIF function.

🔧 Proven Troubleshooting Steps

Using Index-Match with an Array Formula

  1. Step 1: Select cell B5 in the 'All Points' sheet, then go to the formula bar and press 'Ctrl+Shift+Enter' to enter array formula mode. This will allow you to use multiple references in a single formula.
  2. Step 2: In the formula bar, type '=INDEX('Plotted Points'!A:A,MATCH('All Points'!A5,'Plotted Points'!A:A,0))'
  3. Step 3: Press 'Enter' to execute the array formula. This will return the value from the 'Plotted Points' sheet that matches the value in cell B5 of the 'All Points' sheet.

Using a Helper Column

  1. Step 1: Create a new column in the 'All Points' sheet, say C, and enter the formula '=IF(COUNTIF('Plotted Points'!A:A,'All Points'!A5)>0,TRUE,FALSE)' in each cell.
  2. Step 2: Copy the entire column C to all cells in column B. This will apply the same logic to every value in column A of the 'All Points' sheet.

✨ Wrapping Up

To resolve this error, you can use either of two methods: using index-match with an array formula or creating a helper column. Both methods will provide accurate results and eliminate the need for the COUNTIF function. By following these steps, you should be able to successfully check if values exist in the 'Plotted Points' sheet.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions