Count cells between two values in a column

Formula in D15:

=ABS(MATCH(C12, tbl, 0)-MATCH(C13, tbl, 0))-1 + ENTER

Named ranges

tbl (A1:A10)

Count cells between two values in a row

Formula in D23:

=ABS(MATCH(C20, tbl_row, 0)-MATCH(C21, tbl_row, 0))-1 + ENTER

Named ranges

tbl_row (A18:E18)

Download excel sample file for this tutorial.

formula to count cells between two values.xls
(Excel 97-2003 Workbook *.xls)

Functions in this article:

MATCH(lookup_value;lookup_array; [match_type])
Returns the relative position of an item in an array that matches a specified value

ABS(number)
Returns the absolute value of a number, a number without its sign.

  • Share/Bookmark

Related posts:

  1. Count unique and duplicates text values in a closed workbook in excel (formula)
  2. Count matching cell values in two columns in excel
  3. Count unique values in two lists combined in excel
  4. Count unique records by date in excel
  5. Count unique distinct text values in a range in excel
  6. Filter unique distinct values where adjacent cells contain search string in excel
  7. Count unique distinct months in excel
  8. Count unique text values in a range containing both numerical and text values
  9. Merge two columns with possible blank cells in excel (formula)