Count Non-Contiguous Range using COUNTIF

This post will guide you how to count a non-contiguous range with criteria in COUNTIF function in Excel 2013/2016 or Excel office 365. How do I build a formula for counting non-contiguous range in Excel using COUNTIF function in Excel.

What is Non-Contiguous Range?

A non-contiguous range consists of tow of more separate ranges in your current worksheet. And this post will show you one formula that counting the non-contiguous range with criteria in Excel.

Generic Formula

If you want to count a non-contiguous range with criteria, and you can use the COUNTIF function in combination with the INDIRECT and the SUM function. The general formula is like this:


The syntax of Explanations is as below:

  • SUM – the sum function can be used to add up values in the given cells.
  • COUNTIF – COUNT the number of cells that match a certain condition.
  • INDIRECT – return a valid cell reference from a given text string.

COUNT Non-Contiguous Range Using COUNTIF

Assuming you have tree ranges A1:A5, C1:C5, and E1:E5 in your worksheet and you wish to count the number of values that is greater than 80. And you can use the below formula:


count non-contiguous ranges 1

Let’s See That How This Formula Works:

The COUNTIF function can only count the number of cells in a range that match a given condition in Excel. And if you want to use the COUNTIF function with non-contiguous ranges, and you will get an error value. The best method is that you can use the INDIRECT function to get a valid cell reference from an array list that contain multiple text string.

The multiple ranges that returned by the INDIRECT function are passed into COUNTIF function. As the COUNTIF function receives an array list, it will return an array result also.

Finally, you can use the SUM function to add up all items in an array.

You can also use another solution to count Non-contiguous range using COUNTIF function. And using more that one COUNTIF function to count the numbers. The formula is like this:


count non-contiguous ranges 2

Related Functions

  • Excel SUM function
    The Excel SUM function will adds all numbers in a range of cells and returns the sum of these values. You can add individual values, cell references or ranges in excel.The syntax of the SUM function is as below:= SUM(number1,[number2],…)…
  • Excel COUNTIF function
    The Excel COUNTIF function will count the number of cells in a range that meet a given criteria. This function can be used to count the different kinds of cells with number, date, text values, blank, non-blanks, or containing specific characters.etc.= COUNTIF (range, criteria)…
  • Excel INDIRECT function
    The Excel INDIRECT function returns the cell reference based on a text string, such as: type the text string “A2” in B1 cell, it just a text string, so you can use INDIRECT function to convert text string as cell reference….



Related Posts

Match Single Criteria in Excel

No repeat statistic based on a single condition is used wildly in daily work, for example, count type of products, the duplicate types are not encountered. This article describes the way of no repeats statistics for data in a single ...

Excel Array Formula

An array formula is a special formula that is converted from a normal formula by the Ctrl+Shift+Enter shortcut. Excel automatically adds curly brackets "{}" at the beginning and end of an array formula. The essence of the array formula is ...

Excel/Google Sheets: Full Row Reference

Excel or Google sheets supports both full row references and full column references. This article will talk about the usage of full row references. Full Row reference is another cell reference in Excel or Google Sheets, which is used to ...

Excel/Google Sheets: Full Column Reference

Full column reference is another cell reference in Excel or Google Sheets, which is used to reference the entire column, for example, if you want to reference the entire column A, you can use the following reference format A: A. ...

If Cell Contain Specific Text

This article will explain how to check if a cell contains text or a specific text string in Google Sheets or Microsoft Excel spreadsheets. In our daily work, we often look for specific text in worksheets containing large amounts of ...