count(range)
只能算数字
counta(range)
可以算文字
countif(range,condition)
选出每门课的学生数量
select count(cid) from table group by cid
=countif(B:B,1)
=countif(B:B,2)
=countif(B:B,3)

countifs(range1, condition1, range2, conditton2, ..., ...)
选出某门课的不及格的学生数量
select cid, count(*) from (
select * from table where 是否及格=‘不及格’
)t group by cid


数值类型的筛选
选出各科分数>85的学生数
=countifs( B:B, G10, C:C, ">85" )
也可写成
=countifs( B:B, G10, C:C,">"&单元格号码 )这样修改数字时就不用改公式了
日期类型的筛选
选出消费时间在6月份,且消费方式为信用卡的数量
= countifs ( 消费方式域,“信用卡”,时间域,">=1/6/2019",时间域,"<30/6/2019" )
MONTH(d/m/y) 函数可以直接得出月份
。
sumifs ( 求和范围,range1, condition1, range2, conditton2, ..., ...)
按年份和产品计算总金额

网友评论