突出显示Google表格中的重复行 [英] Highlighting Duplicate Rows in Google Sheets

查看:990
本文介绍了突出显示Google表格中的重复行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Google表格中编写脚本,查找2列之间的重复内容,并突出显示整行以指示重复。这里有一个诀窍:


  • 我的表格中有几列,但只比较了其中的两个副本。假设A列和B列。

  • 如果列A中的值与B列重复,则应突出显示整行(或至少列A,B和C)。
  • B列中的重复项也需要突出显示,但仅在A列中找到3个重复项后才需要突出显示。换句话说,它会在每找到3个重复项中突出显示。



目前,我有一个脚本可以突出显示重复内容,但它当我想要突出显示列中的多个单元格时,仅突出显示特定的单元格。此外,其中一列的重复项只有在找到3个重复项后才会突出显示。



任何帮助都将不胜感激。第一部分很简单:

自定义公式:

  = $ A2 = $ B2 

适用范围:

  A2:D13 

在A2中输入(假设一个标题行)。将D改为最后一列。



第二部分有点难理解,但这应该给你一个想法。它检查C列三个副本并突出显示该单元格。添加到C2:

自定义公式:

  = countif($ C2:$ C,$ C2)> 2 

应用于:

  C2:C13 


I'm trying to write a script in Google Sheets that finds duplicates between 2 columns and highlights the entire row to indicate a duplicate. Here is the trick:

  • I have several columns in my sheet but am only comparing 2 of them for duplicates. Lets say column A and B.
  • If a value in column A is found to be a duplicate of column B, it should highlight the entire row (or at least columns A, B, and C).
  • The duplicate in column B will also need to be highlighted but only after 3 duplicates in in column A have been found. In other words, it will be highlighted for every 3 duplicates that are found.

Currently, I have a script that highlights duplicates but it only highlights the specific cell when I'd like multiple cells in the column to be highlighted. Additionally, duplicates for one of the columns are highlighted only after 3 duplicates are found.

Any help with this will be greatly appreciated. Thanks!

解决方案

The first part is easy:

Custom formula:

=$A2=$B2

Apply to Range:

A2:D13

Enter in A2 (Assumes a header row). Change D to last column.

The second part is a little hard to understand, but this should give you an idea. It checks column C for three duplicates and highlights the cell. Add to C2:

Custom formula:

=countif($C2:$C,$C2)>2

Apply to:

C2:C13

这篇关于突出显示Google表格中的重复行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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