google-app-engine - 在 Google 电子表格中标记重复条目

标签 google-app-engine google-apps-script google-sheets

我有一个电子表格,其中 F 列中的条目稍后可能会在 F 中重复。我正在寻找可以执行类似以下伪代码的操作:

当 Ax 不为空时

If value in Gx is empty   
  If cell Ex is identical to other cell Ey
  OR 
  If cell Fx is identical to other cell Fy 
     THEN
       Mark Gy as duplicate
       italics row y

关于使用 Google 的内置应用脚本来完成这项工作有什么建议吗?

免责声明:我不熟悉 JS,但我正在尝试。

最佳答案

你不需要 JS。您可以使用内置的电子表格公式来完成。

听起来你想要我给 this question 的类似答案,不同之处在于您正在检查两列而不是一列。

你想要这个:

=if(AND(COUNTIF($A$1:$A2,A2)=1, COUNTIF($B$1:$B2,B2)=1), "", "Yes")

需要注意的关键是 AND 的使用论坛。

这将向下填充并在后续行中看起来像这样:

=if(AND(COUNTIF($A$1:$A3,A3)=1, COUNTIF($B$1:$B3,B3)=1), "", "Yes")
=if(AND(COUNTIF($A$1:$A4,A4)=1, COUNTIF($B$1:$B4,B4)=1), "", "Yes")
...

这些是使用您的电子表格数据作为示例的结果。这是假设公式已插入 Duplicate? 列 (C2) 并向下填充:

   A                          B               C
1  Contact                    Name            Duplicate?
2  email@example.com          John  
3  repeat.email@example.com   Repeated Name 
4  repeat.email@example.com   Jane            Yes
5  email3@example.com         Repeated Name   Yes

关于google-app-engine - 在 Google 电子表格中标记重复条目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19843406/

相关文章:

java - 我如何保留 oauth token 以便将来可以使用它们?

python - 如何在 Google App Engine 模板系统中注册自定义过滤器?

google-apps-script - '异常: Too many simultaneous invocations: Spreadsheets' - Is it because I am opening spreadsheets in a loop?

javascript - 我收到错误代码 "your day value is invalid"

google-apps-script - 如何暂停谷歌脚本中的onEdit功能

google-app-engine - Google App Engine SSL 证书错误

java - 访问控制异常 : access denied ("java.lang.RuntimePermission" "modifyThreadGroup") while using Firebase with GoogleAppEngine

google-apps-script - 如何从谷歌应用程序脚本上的 "doPost"请求中获取源 URL

google-apps-script - 无法从 Google 电子表格中的工具提示中提取链接文本

javascript - 超过最大执行时间谷歌表格脚本解决方法