[英]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: 多步骤方法:
=IF(A2=A1,0,1)
3) =IF(A2=A1,0,1)
3) 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.