列的不同值,并对每个不同的值进行计数 [英] Distinct value of a column and do a count on each distinct value

查看:116
本文介绍了列的不同值,并对每个不同的值进行计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的列。



我知道如何计数这个列的独特价值,但是我也想做一个不同的值的数量。有一个简单的方法吗?



谢谢。

解决方案

考虑到以下示例:





要获得唯一的值,并且发生每个唯一的值,你可以执行以下操作:



图像很小,所以这里是输入和拖动的公式:



FORMULAS



1。输入列B的第一个单元格



= IF(ISERROR(INDEX($ A $ 2:$ A $ 8,MATCH (0,INDEX(COUNTIF($ B $ 1:B1,$ A $ 2:$ A $ 8),0,0),0))), ,INDEX($ A $ 2:$ A $ 8,MATCH(0,INDEX (COUNTIF($ B $ 1:B1,$ A $ 2:$ A $ 8),0,0),0)))



在列B中的公式。您将获得唯一值列表。



2。输入列C的第一个单元格



= COUNTIF($ A $ 2:$ A $ 8,B2)



将公式拖到列C之下。您将获得每个唯一值的出现次数。



RESULT



这是你会得到的:



< img src =https://i.stack.imgur.com/QHxUP.jpgalt =enter image description here>


Hi I have a column like this.

I know how to count the number of distinct value of this column, but I also want to do a count on what is the number of different distinct value.Is there an easy way to do that?

Thanks.

解决方案

Considering the following example:

To get the unique values, and the occurrences of each unique value, you can do the following:

The image is tiny, so here is are the formulas to type-in and drag down:

FORMULAS

1. Type in the first cell of column B:

=IF(ISERROR(INDEX($A$2:$A$8,MATCH(0,INDEX(COUNTIF($B$1:B1,$A$2:$A$8),0,0),0))),"",INDEX($A$2:$A$8,MATCH(0,INDEX(COUNTIF($B$1:B1,$A$2:$A$8),0,0),0)))

Drag the formula down the column B. You will get a list of unique values.

2. Type in the first cell of column C:

=COUNTIF($A$2:$A$8,B2)

Drag the formula down the column C. You will get the number of occurrences of each unique value.

RESULT

This is what you will get:

这篇关于列的不同值,并对每个不同的值进行计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆