Counts the number of cells in a range that meet a given condition.
Grammar
COUNTIF(range,criteria)
Range is the range of cells in which the number of cells that meet the condition needs to be calculated.
Criteria are criteria that determine which cells will be counted and can be in the form of numbers, expressions, or text.
For example, the condition could be expressed as 32, "32", ">32", or "apples".
Description
WPS tables provide additional functions that can be used to analyze data based on conditions.
For example, to calculate the sum based on a text string or a range of numbers, use the SUMIF worksheet function.
To have a formula return one of two values based on a condition, such as a sales bonus for a specified sales volume, use the IF worksheet function.
Sharing with you today A function with many applications - the COUNTIF function, its function is to count the number of cells with a given condition in the range.
Take the following score statistics table as an example. Now we need to count the number of students in each score range. How many people;
■ Click on the blank cell (E2) below the "Number of People" cell, click "Insert Function", and select the "COUNTIF" function; span>
■ In the pop-up "Function Parameters" dialog box, select the results of column B (B2:B21) in the "Area" and enter the "Condition" ">=90".
Click "OK",to count 7 people with a score of 90 or above.
■ The calculation of the next "80-89" score is the same as the above steps.
In the pop-up "Function Parameters" dialog box,Select the results of column B in the "Area" (B2:B21), enter ">=80" for "Condition".
Click "OK". It should be noted that the calculated value is greater than or equal to 80, includingWhat should we do if we get more than 90 points?
■ Click the cell (E2), copy the formula COUNTIF(B2:B21,">=90") after the = sign, and click √ Number.
Go back to cell (E3) and add a "-" (minus sign) at the end ), and then paste the formula of (E2) just copied.
The cell formula of E3 at this time should be=COUNTIF(B2:B21,"> =80")-COUNTIF(B2:B21,">=90").
Click "Enter" to get the number of people in the "80-89" stage.
■ In the same way, the number of people "60-79" and "below 60 points" can be calculated.
评论列表(196条)
测试