简体   繁体   English

删除重复的Excel-每天

[英]Remove Duplicates Excel - From Each Day

I have a spreadsheet with columns of the following records: 我有一个电子表格,其中包含以下记录的列:

  • Caller ID (Customer's number each call came from) 来电显示(每个电话来自的客户号码)
  • Date (the dates are when the calls came in since January 1 2017) 日期(日期为自2017年1月1日起拨打电话的日期)

How can I efficiently remove duplicate Caller ID's within each day? 如何每天有效地删除重复的来电显示?

If I simply use the Remove Duplicates tool, it will remove duplicates across the entire year so far. 如果我仅使用“删除重复项”工具,那么它将到目前为止清除整个一年中的重复项。

So I pretty much want to remove instances where a customer called more than once in a day. 因此,我非常想删除客户每天多次致电的实例。

Here is an example of the data. 这是数据的示例。

在此处输入图片说明

How can I make it so only the first record from each day shows? 我怎样才能做到只有每天的第一个记录显示?

My actual sheet has over 100k rows 我的实际工作表有超过10万行

Why delete the duplicates? 为什么要删除重复项? Just create a pivot table and it can show the unique values and a count of the duplicates. 只需创建一个数据透视表,它就可以显示唯一值和重复项计数。

Remove duplicates tool should work, Are you sure you have only those 2 columns (number and date) ticked in the Remove duplicates tool? “删除重复项”工具应该可以工作,确定删除“删除重复项”工具中只有这两列(数字和日期)吗?

If not, check the date format 如果不是,请检查日期格式

A quick and dirty solution: 快速而肮脏的解决方案:

Assuming the data is sorted (ascending) by the date to begin with, you could do a primary sort on date and secondary sort on phone numbers. 假设数据以开始的日期排序(升序),则可以对日期进行一次主要排序,并对电话号码进行次要排序。 In an empty column, enter the following formula =(b2-b1)+(c2-c1) (where phone is column b, date is column c and row 2 is your first row of data. Copy and paste to last row of data. Now filter that column for 0 only and then hide or delete those rows. 在一个空列中,输入以下公式=(b2-b1)+(c2-c1) (其中电话是b列,日期是c列,第2行是您的第一行数据。复制并粘贴到数据的最后一行现在,仅将该列过滤为0,然后隐藏或删除这些行。

Now if the data wasn't already sorted by date, and you need it restored to the original order, you could first add a column for a numeric order (ie 1,2,3) with formulas. 现在,如果尚未按日期对数据进行排序,并且您需要将其还原为原始顺序,则可以首先使用公式为数字顺序(即1,2,3)添加一列。 First row (Row 2) of data is a 1, next row is a formula (=a2+1) and copy and paste that to the last row. 数据的第一行(行2)为1,下一行为公式(= a2 + 1),然后将其复制并粘贴到最后一行。 Now when you run the above process, you would delete the rows with zeroes, then run a final sort on Column A to get back to the original order. 现在,当您运行上述过程时,您将删除带有零的行,然后对A列进行最终排序以返回到原始顺序。

Hope that helps. 希望能有所帮助。 If this is a one-time thing that should suffice. 如果这是一次性的事情就足够了。 If not, a macro could do the same thing and shouldn't be too hard to write. 如果没有,宏可以做同样的事情,应该不会太难写。 Or you could leave the extra columns in place or just hide them, for future use. 或者,您可以将多余的列留在原处或将其隐藏起来以备将来使用。

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

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