COUNTIF函數(shù)常規(guī)用法
一、求各種類(lèi)型單元格的個(gè)數(shù)
(1)求真空單元格單個(gè)數(shù):=COUNTIF(data,"=")
(2)真空+假空單元格個(gè)數(shù):=COUNTIF(data,"")相當(dāng)于countblank()函數(shù)
(3)非真空單元格個(gè)數(shù):=COUNTIF(data,"<>")相當(dāng)于counta()函數(shù)
(4)文本型單元格個(gè)數(shù):=COUNTIF(data,"*")假空單元格也是文本型單元格
(5)區(qū)域內(nèi)所有單元格個(gè)數(shù):=COUNTIF(data,"<>""")
(6)邏輯值為T(mén)RUE的單元格數(shù)量:=COUNTIF(data,TRUE)
小說(shuō)明:
EXCEL單元格內(nèi)數(shù)據(jù)主要有以下幾類(lèi):數(shù)值型,文本型,邏輯型,錯(cuò)誤值型。其中時(shí)間類(lèi)型也是一種特殊的數(shù)值。文本類(lèi)型的數(shù)字是文本型??諉卧瘢褐甘裁磧?nèi)容也沒(méi)有的單元格,姑且稱(chēng)之為真空。假空單元格:指0字符的空文本,一般是由網(wǎng)上下載來(lái)的或公式得來(lái)的,姑且稱(chēng)之為假空。date指單元格區(qū)域,該參數(shù)不能是數(shù)組。
二、求><=某個(gè)值的單元格個(gè)數(shù)
(1)大于50:=COUNTIF(data,">50")
(2)等于50:=COUNTIF(data,50)
(3)小于50:=COUNTIF(data,"<50")
(4)大于或等于50:=COUNTIF(data,">=50")
(5)小于或等于50:=COUNTIF(data,"<=50")
(6)大于E5單元格的值:=COUNTIF(data,">"&$E$5)
(7)等于E5單元格的值:=COUNTIF(data,$E$5)
(8)小于E5單元格的值:=COUNTIF(data,"<"&$E$5)
(9)大于或等于E5單元格的值:=COUNTIF(data,">="&$E$5)
(10)小于或等于E5單元格的值:=COUNTIF(data,"<="&$E$5)
三、等于或包含某N個(gè)特定字符的單元格個(gè)數(shù)
(1)兩個(gè)字符:=COUNTIF(data,"??")
(2)兩個(gè)字符并且第2個(gè)是B:=COUNTIF(data,"?B")
(3)包含B:=COUNTIF(data,"*B*")
(4)第2個(gè)字符是B:=COUNTIF(data,"?B*")
(5)等于“你好”:=COUNTIF(data,"你好")
(6)包含D3單元格的內(nèi)容:=COUNTIF(data,"*"&D3&"*")
(7)第2字是D3單元格的內(nèi)容:=COUNTIF(data,"?"&D3&"*")
注:countif()函數(shù)對(duì)英文字母不區(qū)分大小寫(xiě),通配符只對(duì)文本有效
四、兩個(gè)條件求個(gè)數(shù)
(1)>10并且<=15=SUM(COUNTIF(data,">"&{10,15})*{1,-1})
(2)>=10并且<15=SUM(COUNTIF(data,">="&{10,15})*{1,-1})
(3)>=10并且<=15=SUM(COUNTIF(data,{">=10",">15"})*{1,-1})
(4)>10并且<15=SUM(COUNTIF(data,{">10",">=15"})*{1,-1})
注:一般多條件計(jì)數(shù)使用SUMPRODUCT函數(shù),以上方法較少使用,僅供參考。
補(bǔ)充:三個(gè)區(qū)域計(jì)數(shù):三個(gè)區(qū)域中=60
五、各種特殊統(tǒng)計(jì)要求的計(jì)算A1:A100為存放數(shù)據(jù)的區(qū)域
(1)非空文本(僅包括可鍵入文本:=COUNTIF(A1:A100,">=!")
(2)所有非空文本=COUNTIF(A1:A100,">=!")+COUNTIF(A1:A100,">="&CHAR(1))-COUNTIF(A1:A100,">=")或{=SUM(COUNTIF(A1:A100,">="&{"!",""})*{1,-1})+COUNTIF(A1:A100,">="&CHAR(1))}即文本型-含" "(空格)數(shù)量
(3)全部可見(jiàn)單元格{=SUM(N(IF(ISERROR(A1:A100),1,SUBSTITUTE(A1:A100," ",""))<>""))},即全部看上去不是空值的單元格(=全部記錄-真空-空格)
(4)有效可見(jiàn)單元格=COUNTIF(A1:A100,">=!")+COUNTIF(A1:A100,">="&CHAR(1))-COUNTIF(A1:A100,">= ")+COUNT(A1:A100),即所有非空文+數(shù)字型數(shù)據(jù)之和
(5)全部不見(jiàn)單元格(真空+空格+空文本)=COUNTIF(A1:A100,"")+COUNTIF(A1:A100,">=!")+COUNTIF(A1:A100,">=")
(6)空格=COUNTIF(A1:A100,">=")-COUNTIF(A1:A100,">=!")
(7)空文本""=COUNTIF(A1:A100,"")-COUNTIF(A1:A100,"=")
(8)邏輯與錯(cuò)誤=COUNTIF(A1:A100,"<>")-COUNTIF(A1:A100,"*")-COUNT(A1:A100)
繼續(xù)查找其他問(wèn)題的答案?
-
Excel 2019如何使用復(fù)制、粘貼命令插入Word數(shù)據(jù)?(視頻講解)
2021-01-257次播放
-
Excel 2019如何制作數(shù)據(jù)透視表?(視頻講解)
2021-01-2227次播放
-
Excel 2019如何設(shè)置相對(duì)引用?(視頻講解)
2021-01-2210次播放
-
2021-01-2212次播放
-
Excel 2019如何使用命令復(fù)制公式?(視頻講解)
2021-01-226次播放
-
2021-01-223次播放
-
2021-01-222次播放
-
Excel 2019如何利用開(kāi)始選項(xiàng)卡進(jìn)入篩選模式?(視頻講解)
2021-01-223次播放
-
Excel 2019如何設(shè)置指定數(shù)據(jù)的篩選?(視頻講解)
2021-01-223次播放
-
Excel 2019如何設(shè)置自定義排序?(視頻講解)
2021-01-222次播放
- 開(kāi)始學(xué)習(xí)
海報(bào)設(shè)計(jì)精品錄播課程2121次觀(guān)看
開(kāi)始學(xué)習(xí)字體設(shè)計(jì)精品錄播課程2121次觀(guān)看
開(kāi)始學(xué)習(xí)室內(nèi)設(shè)計(jì)精品錄播課程2121次觀(guān)看
開(kāi)始學(xué)習(xí)影視動(dòng)畫(huà)精品錄播課程2121次觀(guān)看
開(kāi)始學(xué)習(xí)UI設(shè)計(jì)精品錄播課程2121次觀(guān)看
開(kāi)始學(xué)習(xí)
點(diǎn)擊加載更多評(píng)論>>