简体   繁体   English

如何删除一列中的所有重复项,并保持值最高的行(来自另一列)

[英]How do I remove all duplicates in one column, and keep the row with highest value (from another column)

I'm trying to remove duplicate CustomerIDs and keep the one with the highest CompositeRank. 我正在尝试删除重复的CustomerID,并保留CompositeRank最高的那个。

CUSTOMERID     STORE      COMPOSITERANK
51872          FOS        5
51872          MOS        3
51872          BOS        2
10098          BOS        5
10098          MOS        3
10098          FOS        2
99102          MOS        5
99102          FOS        3
99102          BOS        2

After removing the proper duplicates, it should look like this: 删除适当的重复项后,它应如下所示:

CUSTOMERID     STORE      COMPOSITERANK
51872          FOS        5
10098          BOS        5
99102          MOS        5

Thanks for your time. 谢谢你的时间。

Multi step approach: 多步骤方法:

  1. Sort by customerID then compositerank Desc 按客户ID排序,然后按Compositerank Desc
  2. Add a formula similar to the following =IF(A2=A1,0,1) 3) 添加类似于以下公式=IF(A2=A1,0,1) 3)
  3. add a filter for 1 achieve results similar to below screenshot. 为1添加过滤器,以实现类似于以下屏幕截图的结果。

在此处输入图片说明

If you need to retain ordering first add a column with 1 and then 1 + row above and fill the series down. 如果您需要保留顺序,请首先添加一列,然后在上方添加1 +行,然后向下填充系列。 Then after step 3, re-order based on column added. 然后在步骤3之后,根据添加的列重新排序。

you can then copy /paste results to different worksheet if needed, or just leave the non-highest ones hidden. 然后,您可以根据需要将结果复制/粘贴到其他工作表中,或仅将非最高结果隐藏。

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

相关问题 删除重复项并根据另一列中的值指望一列 - Remove duplicates and count on one column based on values from another column 删除重复项并根据另一列中的值指望一列 - Remove duplicates and count on one column based on values from another column 如何根据在另一列中选择的行数据从列中收集值? - How do I collect value from a column base on it's row data selected in another column? 在excel中,从一系列行中,返回另一列中具有最高值的行的列值 - In excel, from a range of rows, return the column value of the row with the highest value from another column 根据另一列值删除excel中的重复项 - Remove duplicates in excel based on another column value 如何在excel中创建一个公式来搜索行中的值,然后从该列中的另一个单元格中获取值? - How do I create a formula in excel that searches for a value in row, and then takes the value from another cell in that column? 在Excel中,搜索一列以获取存在于另一列的最大值 - In Excel, search one column for highest value that exists that is linked to another column 从Excel中的A列中删除所有重复项 - Remove ALL duplicates from column A in Excel 根据另一列中的日期删除一列中的重复项 - Remove duplicates in one column based on a date in another column 如何根据“键”列删除重复行? - How do I remove the rows of duplicates based on a "key" column?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM