开始使用免费开始使用

Conditional summary statistics

In Data Analysis in Google Sheeets, you saw how to use COUNTIF() to calculate summary statistics. Here's you'll take it one step further using the related COUNTIFS() function, which lets you pass multiple conditions to it.

Arguments to COUNTIFS() come in pairs: a range of values to filter on, best given as absolute addresses, and a condition. The condition is text consisting of

  1. a value to match, or
  2. a comparison operator (=, <, >=, etc.) and a number.

For example, COUNTIFS(A2:A100, "DataCamp", B2:B100, ">10") counts the number of values where column A matches "DataCamp" and column B is greater than 10.

本练习是课程的一部分

Google Sheets 中级

查看课程

练习说明

  • In cell H2, get the unique Area values using UNIQUE().
  • In column I, use COUNTIF() to get the count of each Area. Pass the data range from A2 to A45 as absolute addresses, and the filter criteria from H2 to H9.
  • In column J, use COUNTIFS() to get the count of each area with more than 20 Swallow-tails. the first two arguments are the same as the previous step, then add a condition for column D to be greater than 20.

动手互动练习

通过我们的互动练习之一,将理论转化为实践

开始练习