假设data1={a, b, c, a, d, c, a}
countif(data1,data1)意思是:{countif(data1,a);countif(data1,b);countif(data1,c);countif(data1,a);countif(data1,d);countif(data1,c);countif(data1,a);}
返回结果是:{3,1,2,3,1,2,3}
即:
a在data1出现了3次;
b在data1出现了1次;
c在data1出现了2次;
a在data1出现了3次;
d在data1出现了1次;
c在data1出现了2次;
a在data1出现了3次;
还是应用上面的结果:
sum(1/countif(data1,data1))
=sum(1/{3,1,2,3,1,2,3})
=sum({ 1/3, 1/1, 1/2, 1/3, 1/1, 1/2, 1/3 })
={ 1/3 + 1/1 + 1/2 + 1/3 + 1/1 + 1/2 + 1/3 } sum求和就是将各元素相加
={ (1/3 + 1/3 + 1/3) + (1/1 + 1/1) + (1/2 + 1/2) }
={ (1) + (2) + (1) }
={ 4 }
最后的结果表明在data1里有4个不重复的值。
row(1:1)则是取第第1行到第1行的行号数组:{1}
row(1:1)>sum(1/countif(data1,data1)相当于:{1}>{4}=false
不过,上面的前提是你输入公式后要按ctrl+shift+enter输入数组公式才会出来false的结果。不然sum(1/countif(data1,data1)会直接输出数组中第一个值。
又或者你的公式写成这样:row(1:1)>sumproduct(1/countif(data1,data1)就可以直接回车即可。
温馨提示:答案为网友推荐,仅供参考