Skip to content
Dropfile

COUNTIF Function

Counts the number of cells in a range that meet a single condition. One of the most commonly used functions for data analysis.

ExcelGoogle Sheets

语法

COUNTIF(range, criteria)

参数

参数名说明
rangeThe range of cells to count.
criteriaThe condition that determines which cells to count.

示例

Count orders from a specific region

=COUNTIF(A2:A100, "East")

结果: 23

Count values above a threshold

=COUNTIF(B2:B100, ">1000")

结果: 15

Count non-blank cells

=COUNTIF(A2:A100, "<>")

结果: 87

Count cells containing specific text

=COUNTIF(A2:A100, "*apple*")

结果: Counts cells containing 'apple' anywhere in the text

技巧与最佳实践

相关公式

需要其他公式?

用自然语言描述您的需求,AI 将为您生成公式。

试试公式生成器