Use the COUNTIF function in Microsoft Excel
Use COUNTIF, one of the statistical functions, to count the number of cells that meet a criterion; for example, to count the number of times a particular city appears in a customer list.
Applies To:
Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016
COUNTIFS function | Microsoft Support
How to use the COUNTIFS function in Excel to apply criteria to cells, across multiple ranges, and count the number of times all criteria are met.
Applies To:
Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016, Excel Web App
COUNTIF function - Microsoft Support
Use COUNTIF, one of the statistical functions, to count the number of cells that meet a criterion; for example, to count the number of times a particular city appears in a customer list.
Applies To:
Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel for the web, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016, Microsoft Office, Microsoft365.com
Ways to count values in a worksheet | Microsoft Support
Watch the following video to see how to use the COUNT function and how to use the COUNTIF and COUNTA functions to count only the cells that meet conditions you specify.
Applies To:
Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016
Count numbers or dates based on a condition in Excel
To count numbers or dates that meet a single condition (such as equal to, greater than, less than, greater than or equal to, or less than or equal to), use the COUNTIF function.
Applies To:
Excel for Microsoft 365, Excel 2024, Excel 2021, Excel 2019, Excel 2016
Count how often a value occurs in Excel | Microsoft Support
There are several ways to count how often a value occurs. Use the COUNTIF function to count how many times a particular value appears in a range of cells. For more information, see COUNTIF function.
Applies To:
Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016
在 Microsoft Excel 中使用 COUNTIF 函数
在 Excel 中使用 COUNTIF 的示例 要在 Excel 中使用这些示例,请复制下表中的数据,然后将其粘贴进新工作表的 A1 单元格中。
Applies To:
Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016
Count numbers greater than or less than a number
Use COUNTIF to count the number of cells that meet a specific criteria. For example, you are preparing a report and want to count how many sales invoices were greater or lesser than a particular value.
Applies To:
Excel for Microsoft 365, Excel 2024, Excel 2021, Excel 2019, Excel 2016
Ways to count cells in a range of data in Excel
COUNTIF: To count cells that meets a specified criteria. To enter more than one criterion, use the COUNTIFS function instead. Select the range of cells that you want, and then press RETURN.
Applies To:
Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac
COUNT function - Microsoft Support
If you want to count only numbers that meet certain criteria, use the COUNTIF function or the COUNTIFS function. Example Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter.
Applies To:
Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel for the web, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016, Microsoft Office