简体   繁体   English

MS Excel数不清

[英]MS Excel count distinct where

I am using MS Excel 2013, and I am trying to run something like a Count distinct where. 我正在使用MS Excel 2013,并且试图在类似Count的不同地方运行。 Here is my table 这是我的桌子

Name:
jim
james
frank
jillian
jim
john
patrick
jillian
anna
isabelle

I am trying to do a count distinct where name starts with a J, which would result in 4. Here is what I have so far. 我正在尝试做一个区分,其中名称以J开头,这将导致4。这就是我到目前为止的内容。

SUMPRODUCT(1/countif([names],[names]))   --- This counts unique names

SUMPRODUCT(--(LEFT([names],1)="j"))   --- This counts all names that start with J

Im trying to find a way to combine these two together to count unique names that start with J. Thanks in advance. 我试图找到一种方法将这两者结合在一起以计算以J开头的唯一名称。在此先感谢。

I figured it out. 我想到了。 This ended up working. 最终工作了。

=SUMPRODUCT(IF(LEFT([names])="j",1/COUNTIF([names],[names]))) = SUMPRODUCT(IF(LEFT([names])=“ j”,1 / COUNTIF([names],[names])))

请试试:

=SUMPRODUCT((LEFT(A2:A99)="J")/COUNTIF(A2:A99,A2:A99&""))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM