對(duì)于輸入了一排數(shù)據(jù)后的表格,比如12,25,36,10,12,25,40,53,64,25,36,36,25,3,6,77,13,16,19,28這20個(gè)數(shù)據(jù),我想統(tǒng)計(jì)其中不重復(fù)的數(shù)據(jù)個(gè)數(shù),應(yīng)該怎么操作?
假設(shè)你的數(shù)據(jù)在A2:A21,
1、統(tǒng)計(jì)數(shù)據(jù)個(gè)數(shù)(重復(fù)數(shù)據(jù)只計(jì)算1次)
=SUMPRODUCT(1/COUNTIF(A2:A21,A2:A21))
2、統(tǒng)計(jì)數(shù)據(jù)個(gè)數(shù)(重復(fù)數(shù)據(jù)不統(tǒng)計(jì))
=SUMPRODUCT(--(COUNTIF(A2:A21,A2:A21)=1))
3、列出數(shù)據(jù)(重復(fù)數(shù)據(jù)只列1次),在B2輸入:
=IF(ROW(INDIRECT("1:"&ROWS(A2:A21)))<=SUM(1/COUNTIF(A2:A21,A2:A21)),INDEX(A2:A21,SMALL(IF(MATCH($A$2:$A$21,$A$2:$A$21,0)=ROW(INDIRECT("1:"&ROWS(A2:A21))),ROW(INDIRECT("1:"&ROWS(A2:A21))),""),ROW(INDIRECT("1:"&SUM(1/COUNTIF(A2:A21,A2:A21)))))),"")
完成后,從B2開始選擇B2到B21,按F2,按Ctrl+Shift+Enter。(這是個(gè)數(shù)組公式)。
4、列出數(shù)據(jù)(重復(fù)數(shù)據(jù)不列出),在B2輸入:
=IF(ROW(INDIRECT("1:"&ROWS(A2:A21)))<=SUMPRODUCT(--(COUNTIF(A2:A21,A2:A21)=1)),INDEX(A2:A21,SMALL(IF(COUNTIF(A2:A21,A2:A21)=1,ROW(INDIRECT("1:"&ROWS(A2:A21))),""),ROW(INDIRECT("1:"&SUMPRODUCT(--(COUNTIF(A2:A21,A2:A21)=1)))))),"")
本文來自CSDN博客,轉(zhuǎn)載請(qǐng)標(biāo)明出處:[url=http://blog.csdn.net/lanmao100/archive/2008/08/20/2799592.aspx]http://blog.csdn.net/lanmao100/archive/2008/08/20/2799592.aspx[/url]
聯(lián)系客服