r 对一列计数
How can you count items in one column, based on a criterion in a different column? We've shipped orders to the East region, and want to know how many orders had problems (a problem note is entered in column D). COUNTIF sounds like the right function to use, but it doesn't work for this problem.
如何根据另一列中的条件对一列中的项目进行计数? 我们已将订单运送到东部地区,并想知道有多少订单有问题(在D列中输入了问题说明)。 COUNTIF听起来像要使用的正确函数,但不适用于此问题。
容易根据标准求和 (Easy to Sum Based on Criteria)
If we want to get a total quantity for the East region orders, it's easy to do with the SUMIF function. We can check region names in column B, then sum the amounts in column C.
如果我们想获取东部地区订单的总数量,则可以轻松使用SUMIF函数 。 我们可以检查B列中的区域名称,然后将C列中的金额相加。
=SUMIF(B2:B11