Bạn xem nhé :
Applies to: Microsoft Office Excel 2007
Counts the number of cells within a range that meet multiple criteria.
Syntax
COUNTIFS(
range1,
criteria1,range2, criteria2…)
Range1, range2, … are 1 to 127 ranges in which to evaluate the associated criteria. Cells in each range must be numbers or names, arrays, or references that contain numbers. Blank and text values are ignored.
Criteria1, criteria2, … are 1 to 127 criteria in the form of a number, expression, cell reference, or text that define which cells will be counted. For example, criteria can be expressed as 32, "32", ">32", "apples", or B4.
Remarks
- Each cell in a range is counted only if all of the corresponding criteria specified are true for that cell.
- If criteria is an empty cell, COUNTIFS treats it as a 0 value.
- You can use the wildcard characters, question mark (?) and asterisk (*), in criteria. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character.
Example
The example may be easier to understand if you copy it to a blank worksheet.
How to copy an example
- Create a blank workbook or worksheet.
- Select the example in the Help topic.
Note Do not select the row or column headers.
Selecting an example from Help
- Press CTRL+C.
- In the worksheet, select cell A1, and press CTRL+V.
- To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.
Ví dụ
0….A……………B………..……C….………D
1…Davolio……...Yes…………...No………..No
2….Buchanan…...Yes…………..Yes………..No
3…Suyama…….Yes…………….Yes…….…Yes
4…..Leverling…No……………..Yes………..Yes
=
COUNTIFS(B2

2,"=Yes"

= 1
=
COUNTIFS(B2:B5,"=Yes",C2:C5,"=Yes"

= 2
=
COUNTIFS(B5

5,"=Yes",B3

3,"=Yes"

= 1
Thân!