EXCEL數(shù)據(jù)個數(shù)統(tǒng)計問題 對于輸入了一排數(shù)據(jù)后的表格,比如12,25,36,10,12,25,40,53,64,25,36,36,25,3,6,77,13,16,19,28這20個數(shù)據(jù),我想統(tǒng)計其中不重復的數(shù)據(jù)個數(shù),應(yīng)該怎么操作? 假設(shè)你的數(shù)據(jù)在A2:A21, 1、統(tǒng)計數(shù)據(jù)個數(shù)(重復數(shù)據(jù)只計算1次) =SUMPRODUCT(1/COUNTIF(A2:A21,A2:A21)) 2、統(tǒng)計數(shù)據(jù)個數(shù)(重復數(shù)據(jù)不統(tǒng)計) =SUMPRODUCT(--(COUNTIF(A2:A21,A2:A21)=1)) 3、列出數(shù)據(jù)(重復數(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。(這是個數(shù)組公式)。 4、列出數(shù)據(jù)(重復數(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)載請標明出處:[url=http://blog.csdn.net/lanmao100/archive/2008/08/20/2799592.aspx]http://blog.csdn.net/lanmao100/archive/2008/08/20/2799592.aspx[/url] |
|