在excel中列出不同的值 [英] list distinct values in excel

查看:124
本文介绍了在excel中列出不同的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题与 有关

我的数据如下。

 Col A
22-Oct-12
22-Oct-12
22-Oct-12
23-Oct-12
23-Oct-12
23-Oct-12
23-Oct-12
23-Oct-12
23-Oct-12
24-Oct-12
24-Oct-12
24-Oct-12

我想要的是在列B中找到唯一的值,以便输出如下。

What I want is find the unique values in column B so that output would be as below.

 Col A
22-Oct-12
23-Oct-12
24-Oct-12

我尝试使用 = IF(COUNTIF(A $ 1:A1,A1)= 1,A1,)但问题是我得到 22-Oct-12 第一次出现 10-Oct-12 -12 第一次出现 -10-Oct-12 。输出如下所示。

I tried with =IF(COUNTIF(A$1:A1,A1)=1,A1,"") but the problem is that I get 22-Oct-12 infront of first occurrence of 22-Oct-12, 23-Oct-12 infront of first occurrence of 23-Oct-12. Output is shown as below.

 Col A       Col B
22-Oct-12   22-Oct-12
22-Oct-12   
22-Oct-12   
23-Oct-12   23-Oct-12
23-Oct-12   
23-Oct-12   
23-Oct-12   
23-Oct-12   
23-Oct-12   
24-Oct-12   24-Oct-12
24-Oct-12   
24-Oct-12   

我不想要这样的输出。我想要的是如下。

 Col A       Col B
22-Oct-12   22-Oct-12
22-Oct-12   23-Oct-12
22-Oct-12   24-Oct-12
23-Oct-12   
23-Oct-12   
23-Oct-12   
23-Oct-12   
23-Oct-12   
23-Oct-12   
24-Oct-12   
24-Oct-12   
24-Oct-12   





OR

 Col A      Col B          Col C
22-Oct-12   22-Oct-12   22-Oct-12
22-Oct-12               23-Oct-12
22-Oct-12               24-Oct-12
23-Oct-12   23-Oct-12
23-Oct-12   
23-Oct-12   
23-Oct-12   
23-Oct-12   
23-Oct-12   
24-Oct-12   24-Oct-12
24-Oct-12   
24-Oct-12   

注意: > 我可以通过MACRO做到这一点,但是我不想使用MACRO。我想通过使用excel函数来完成这个工作。

Note : I can do this by MACRO, however I don't want to use MACRO. I want to get this done by use of excel functions.

另外,我可以按照这个答案,但是我不想手动完成。

Also, I could do above as per this answer, however I don't want to get done manually.

一切都是通过预定义的excel函数。

Everything by pre-defined excel function. NO MACRO or NO MANUAL WORK.

推荐答案

假设数字数据(例如数字或日期).....

Assuming numeric data (e.g. numbers or dates).....

在B1中使用此公式

= MIN(A1:A1000)

然后在B2中(假设Excel 2007或更高版本)

and then in B2 (assuming Excel 2007 or later)

= IFERROR (SMALL(A $ 1:A $ 1000> B1,A $ 1:A $ 1000),1),)

。 ..或在早期Excel版本中

...or in earlier Excel versions

= IF(COUNTIF(A $ 1:A $ 1000,>& B1),MIN IF(A $ 1:A $ 1000> B1,A $ 1:A $ 1000)),)

确认与 CTRL + SHIFT + ENTER 并复制

如果您有超过1000行的数据相应调整。

If you have more than 1000 rows of data adjust accordingly.

此方法将按时间顺序列出日期,而不重复,但是它们是在数据中排序

This method will list dates in chronological order without repeats however they are ordered within the data

这篇关于在excel中列出不同的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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