Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 Excel năm nhâm thìn for Mac Excel 2013 Excel Web App Excel 2010 More...Less
The COUNTIFS function applies criteria vĩ đại cells across multiple ranges and counts the number of times all criteria are met.
Bạn đang xem: countifs
This đoạn Clip is part of a training course called Advanced IF functions.
Syntax
COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2]…)
The COUNTIFS function syntax has the following arguments:
-
criteria_range1 Required. The first range in which vĩ đại evaluate the associated criteria.
-
criteria1 Required. The criteria in the size of a number, expression, cell reference, or text that define which cells will be counted. For example, criteria can be expressed as 32, ">32", B4, "apples", or "32".
-
criteria_range2, criteria2, ... Optional. Additional ranges and their associated criteria. Up vĩ đại 127 range/criteria pairs are allowed.
Important: Each additional range must have the same number of rows and columns as the criteria_range1 argument. The ranges tự not have vĩ đại be adjacent vĩ đại each other.
Remarks
-
Each range's criteria is applied one cell at a time. If all of the first cells meet their associated criteria, the count increases by 1. If all of the second cells meet their associated criteria, the count increases by 1 again, and sánh on until all of the cells are evaluated.
-
If the criteria argument is a reference vĩ đại an empty cell, the COUNTIFS function treats the empty cell as a 0 value.
-
You can use the wildcard characters— the question mark (?) and asterisk (*) — in criteria. A question mark matches any single character, and an asterisk matches any sequence of characters. If you want vĩ đại find an actual question mark or asterisk, type a tilde (~) before the character.
Example 1
Copy the example data in the following tables, and paste it in cell A1 of a new Excel worksheet. For formulas vĩ đại show results, select them, press F2, and then press Enter. If you need vĩ đại, you can adjust the column widths vĩ đại see all the data.
Salesperson |
Exceeded Q1 quota |
Exceeded Q2 quota |
Exceeded Q3 quota |
---|---|---|---|
Davidoski |
Yes |
No |
No |
Burke |
Yes |
Yes |
No |
Sundaram |
Yes |
Yes |
Yes |
Levitan |
No |
Yes |
Yes |
Formula |
Description |
Result |
|
=COUNTIFS(B2:D2,"=Yes") |
Counts how many times Davidoski exceeded a sales quota for periods Q1, Q2, and Q3 (only in Q1). |
1 |
|
=COUNTIFS(B2:B5,"=Yes",C2:C5,"=Yes") |
Counts how many salespeople exceeded both their Q1 and Q2 quotas (Burke and Sundaram). |
2 Xem thêm: Bong da lu - Cập nhật kết quả, tỷ số trực tuyến bóng đá nhanh nhất, chính xác nhất |
|
=COUNTIFS(B5:D5,"=Yes",B3:D3,"=Yes") |
Counts how many times Levitan and Burke exceeded the same quota for periods Q1, Q2, and Q3 (only in Q2). |
1 |
Example 2
Data |
||
---|---|---|
1 |
5/1/2011 |
|
2 |
5/2/2011 |
|
3 |
5/3/2011 |
|
4 |
5/4/2011 |
|
5 |
5/5/2011 |
|
6 |
5/6/2011 |
|
Formula |
Description |
Result |
=COUNTIFS(A2:A7,"<6",A2:A7,">1") |
Counts how many numbers between 1 and 6 (not including 1 and 6) are contained in cells A2 through A7. |
4 |
=COUNTIFS(A2:A7, "<5",B2:B7,"<5/3/2011") |
Counts how many rows have numbers that are less phàn nàn 5 in cells A2 through A7, and also have dates that are are earlier phàn nàn 5/3/2011 in cells B2 through B7. |
2 |
=COUNTIFS(A2:A7, "<" & A6,B2:B7,"<" & B4) |
Same mô tả tìm kiếm as the previous example, but using cell references instead of constants in the criteria. |
2 |
Need more help?
You can always ask an expert in the Excel Tech Community or get tư vấn in Communities.
See Also
To count cells that aren't blank, use the COUNTA function
To count cells using a single criteria, use the COUNTIF function
The SUMIF function adds only the values that meet a single criteria
The SUMIFS function adds only the values that meet multiple criteria
IFS function (Microsoft 365, Excel năm nhâm thìn and later)
Overview of formulas in Excel
How vĩ đại avoid broken formulas
Detect errors in formulas
Statistical functions
Excel functions (alphabetical)
Xem thêm: anydesk download
Excel functions (by Category)
Bình luận