Counting formulas
Count rows that match one condition or several, between dates, by text, blanks and unique values. 6 answers, each checked by running it, with a live example and an exercise.
How to count cells between two dates in Excel
=COUNTIFS(B2:B11,">="&G1,B2:B11,"<="&G2)Use COUNTIFS with two conditions on the same date column: on or after the start date, and on or before the end date.
How to count cells that contain specific text in Excel
=COUNTIF(A2:A10,"*"&D1&"*")Use COUNTIF with wildcards: =COUNTIF(range,"*"&text&"*") counts every cell that contains the text anywhere.
How to count with multiple criteria in Excel
=COUNTIFS(B2:B10,G1,C2:C10,">="&G2,D2:D10,"Won")Use COUNTIFS with one range-and-condition pair per criterion; a row is counted only when all of them are true.
How to count unique values in Excel
=COUNTA(UNIQUE(A2:A10))In Excel 365, wrap UNIQUE in COUNTA: =COUNTA(UNIQUE(range)). In older versions, use =SUMPRODUCT(1/COUNTIF(range,range)).
How to count cells that are not blank in Excel
=COUNTA(C2:C8)Use =COUNTA(range). It counts every cell that has anything in it: numbers, text, dates and errors.
How to count cells greater than a number in Excel
=COUNTIF(B2:B8,">"&E1)Use COUNTIF with the operator in quotes joined to the cell: =COUNTIF(range,">"&E1).