谷歌书签删除重复

Google Sheets lets you remove duplicates from your document with three methods ranging from a simple integrated function to a custom script. While it’s not as apparent as in Excel, Sheets offers a more diverse way to remove duplicates in your spreadsheet.

Google表格可以让您通过三种方法(从简单的集成函数到自定义脚本)从文档中删除重复项。 虽然它不像在Excel中那样明显 ,但是Sheets提供了一种更加多样化的方法来删除电子表格中的重复项。

Update: You can now do this with the built-in “Remove Duplicates” tool in Google Sheets.

更新 :现在,您可以使用Google表格中的内置“ 删除重复项 ”工具来执行此操作。

使用唯一功能删除重复项 (Remove Duplicates Using the Unique Function)

The first method we’re going to look at uses the built-in Google Sheets function that finds all unique entries, letting you get rid of everything else in the data set.

我们将要研究的第一种方法是使用内置的Google表格功能来查找所有唯一条目,从而摆脱数据集中的所有其他内容。

Fire up your browser and open up a spreadsheet to get started.

启动浏览器并打开电子表格以开始使用。

Next, click the empty cell where you want the data to output, type =UNIQUE, and then click on the suggested function that appears in the dialog window.

接下来,单击要在其中输出数据的空单元格,键入=UNIQUE ,然后单击出现在对话框窗口中的建议功能。

From here, you can either manually enter the range of cells or highlight them for the function to parse. When you’re done, hit Enter.

在这里,您可以手动输入单元格的范围,也可以突出显示它们以供函数解析。 完成后,按Enter。

Just like magic, Sheets picks out all the unique results and displays them in the selected cell.

就像魔术一样,Sheets会挑选出所有唯一结果并将其显示在所选单元格中。

If you copy and paste the information back into a Google Sheet, be sure to right-click where you want to paste and then choose Paste Special > Paste Values Only—otherwise, only the formula gets copied into the new cell.

如果您将信息复制并粘贴回Google表格中,请确保右键单击要粘贴的位置,然后选择“选择性粘贴”>“仅粘贴值”-否则,仅将公式复制到新单元格中。

使用附加组件删除重复项 (Remove Duplicates Using an Add-On)

For the next method, you’ll need to install an add-on to Google Sheets. If you’ve never used an add-on before, they’re similar to browser extensions that unlock extra additional features for you inside of Google apps, like Docs, Sheets, and Slides.

对于下一种方法,您需要在Google表格中安装插件 。 如果您以前从未使用过插件,则它们类似于浏览器扩展程序,可以在Google应用程序内为您解锁额外的附加功能,例如文档,表格和幻灯片。

For this example, we’ll be using Remove Duplicates by AbleBits. It comes with a free trial for 30 days; premium memberships are $59.60 for a lifetime subscription or $33.60 annually.

在此示例中,我们将使用AbleBits删除重复项 。 它具有30天的免费试用期; 高级会员的终身订阅费用为59.60美元,或每年33.60美元。

安装附加组件 (Installing the Add-On)

To get an add-on, open a file in Google Sheets, click “Add-ons,” and then click “Get add-ons.”

要获取加载项,请在Google表格中打开一个文件,单击“加载项”,然后单击“获取加载项”。

Type “Duplicates” into the search bar and then click the “Free” button.

在搜索栏中输入“重复项”,然后单击“免费”按钮。

Click on the Google account you want to use to install the add-on.

单击您要用于安装附件的Google帐户。

Upon installing add-ons, you need to grant them specific permissions. These are fundamental to the operation of the add-on. Make sure you fully understand the permissions and trust the developer before installing any add-on.

安装加载项后,需要授予他们特定的权限。 这些是插件操作的基础。 在安装任何附加组件之前,请确保您完全理解权限并信任开发人员。

Click “Allow.”

点击“允许”。

使用附加组件 (Using the Add-on)

You can use the Remove Duplicates add-on for a single column or across multiple rows. In this example, we’ll be looking for duplicates in rows, but it works mostly the same for a single column.

您可以对单列或多行使用“删除重复项”加载项。 在此示例中,我们将在行中查找重复项,但对于单个列,其工作原理几乎相同。

In your spreadsheet, highlight all the rows you want to search for duplicates. After that, click Add-ons > Remove Duplicates > Find duplicate or unique rows.

在电子表格中,突出显示要搜索重复项的所有行。 之后,单击附加组件>删除重复项>查找重复或唯一行。

After the add-on opens, check to make sure the range listed is correct and then click “Next.”

加载项打开后,检查以确保列出的范围正确,然后单击“下一步”。

Next, choose the type of data you want to find. Because we’re removing duplicates, select “Duplicates” and then click “Next.”

接下来,选择要查找的数据类型。 因为我们要删除重复项,所以选择“重复项”,然后单击“下一步”。

Select the columns for the add-on to search. If you didn’t include the headers—or maybe your table doesn’t have any headers at all—making sure to untick the “My table has headers” option. Otherwise, the first row will be omitted. Click “Next.”

选择要搜索的加载项的列。 如果您不包括标题(或者您的表根本没有任何标题),请确保取消选中“我的表有标题”选项。 否则,将省略第一行。 点击下一步。”

Finally, choose what the add-on will do with its findings and then click “Finish.”

最后,选择加载项将如何处理其发现,然后单击“完成”。

On the results page, the add-on tells us that four duplicate rows were found and removed.

在结果页面上,该加载项告诉我们找到并删除了四个重复的行。

Voila! All duplicate rows disappear off of your sheet.

瞧! 所有重复的行将从工作表中消失。

使用Google脚本编辑器删除重复的行 (Remove Duplicate Rows with Google Script Editor)

The final method for removing duplicates in your sheet involves using Google App Script, a free-to-use cloud-based development platform for creating custom, light-weight web applications. Although it involves writing code, don’t let that scare you off. Google provides extensive documentation and even supplies you with the script for removing duplicates. Just copy the code, verify the add-on, and then run it inside your sheet.

删除工作表中重复项的最后一种方法涉及使用Google App Script ,这是一个免费的基于云的开发平台,用于创建自定义的轻量级Web应用程序。 尽管它涉及编写代码,但是不要让它吓到您。 Google提供了广泛的文档 ,甚至为您提供了用于删除重复项的脚本。 只需复制代码,验证加载项,然后在工作表中运行它即可。

From the current Google Sheet, click “Tools” and then click “Script Editor.”

在当前的Google表格中,单击“工具”,然后单击“脚本编辑器”。

Google Apps Script opens in a new tab with an empty script.

Google Apps脚本会在一个带有空脚本的新标签页中打开。

Delete the empty function inside the file and paste in the following code:

删除文件中的空函数,然后粘贴以下代码:

//Removes duplicate rows from the current sheet.
function removeDuplicates() {
//Get current active Spreadsheet
var sheet = SpreadsheetApp.getActiveSheet();
//Get all values from the spreadsheet's rows
var data = sheet.getDataRange().getValues();
//Create an array for non-duplicates
var newData = [];
//Iterate through a row's cells
for (var i in data) {
var row = data[i];
var duplicate = false;
for (var j in newData) {
if (row.join() == newData[j].join()) {
duplicate = true;
}
}
//If not a duplicate, put in newData array
if (!duplicate) {
newData.push(row);
}
}
//Delete the old Sheet and insert the newData array
sheet.clearContents();
sheet.getRange(1, 1, newData.length, newData[0].length).setValues(newData);
}

Save and rename your script. Hit the “Run” icon when you’re done.

保存并重命名脚本。 完成后,点击“运行”图标。

You’ll have to review the permissions your script requires and grant it access your spreadsheet. Click “Review Permissions” to see what access this script wants.

您必须查看脚本所需的权限,并授予其访问电子表格的权限。 单击“查看权限”以查看此脚本需要的访问权限。

Accept the prompts and then click “Allow” to authorize the script.

接受提示,然后单击“允许”以授权脚本。

After it finishes running, go back to your Sheet and, just like the previous methods, all duplicate entries vanish from your file!

完成运行后,返回到工作表,就像以前的方法一样,所有重复的条目都将从文件中消失!

Unfortunately, if your data is inside of a table—like the example shown above—this script will not resize the table to fit the number of entries in it, and you’ll have to fix that manually.

不幸的是,如果您的数据在表中(如上面的示例所示),则此脚本将不会调整表的大小以适合表中条目的数量,因此您必须手动对其进行修复。



That’s all there is to it. Whether you want to use the integrated Unique function, a third-party add-on, or create a custom add-on with Apps Script, Google gives you multiple ways to manage duplicates in your spreadsheet.

这里的所有都是它的。 无论您是要使用集成的唯一功能,第三方加载项,还是要通过Apps脚本创建自定义加载项,Google都可以为您提供多种方法来管理电子表格中的重复项。

翻译自: https://www.howtogeek.com/413134/how-to-remove-duplicates-in-google-sheets/

谷歌书签删除重复

谷歌书签删除重复_如何删除Google表格中的重复项相关推荐

  1. 如何在谷歌地图自定义范围_如何在Google表格中更改和创建自定义数字格式

    如何在谷歌地图自定义范围 Khamosh Pathak Khamosh Pathak By default, Google Sheets doesn't format numbers. If you' ...

  2. 电子表格多轴图表_如何在Google表格中切换图表轴

    电子表格多轴图表 When you're creating graphs or charts in Google Sheets, you don't need to stick with the de ...

  3. wps迷你版表格内文字缩放_如何在Google表格中使用迷你图

    wps迷你版表格内文字缩放 When you're working with large amounts of data in a Google Sheets spreadsheet, it isn' ...

  4. axure低保真原型_如何在Google表格中创建低保真原型

    axure低保真原型 Google Sheets is a spreadsheet, just like Microsoft Excel. Google表格是一个电子表格,就像Microsoft Ex ...

  5. 谷歌日历一键删除日程_如何在Google日历中删除新的提醒

    谷歌日历一键删除日程 In December 2015, Google added reminders to the Google Calendar app for Android and iOS u ...

  6. 谷歌中阻止冒泡在火狐中失效_如何在Google表格中乘数字

    谷歌中阻止冒泡在火狐中失效 Whether you have two integers, a few cells, or a couple of columns that need to be mul ...

  7. 在谷歌控制台上怎么换行_如何在Google表格中的单元格中换行

    在谷歌控制台上怎么换行 When you type text in a cell, Google Sheets automatically hides anything that extends be ...

  8. 谷歌浏览器的翻译功能在哪_如何在Google表格中使用AND和OR功能

    谷歌浏览器的翻译功能在哪 If you've ever wanted to check whether data from your Google Sheets spreadsheet meets c ...

  9. ios谷歌地图显示不出来_在iOS Google Maps中显示行进方向

    ios谷歌地图显示不出来 Taxi or travel apps always need to show the direction of travel on the map. In this qui ...

最新文章

  1. ISA三向外围网络模板说明
  2. spring框架的概述以及spring中基于XML的IOC配置——概念
  3. HTML5 技术在风电、光伏等新能源领域的应用
  4. vue移动端300毫秒延时
  5. 45道mysql数据库题目_MySQL 45道练习题
  6. vs连接mysql出错解决方法
  7. sublime text 2/3 快捷键汇总
  8. JAVA API 1.8版本文档下载( 百度网盘 )
  9. 2020年尾矿考试技巧及尾矿考试平台
  10. html 倒计时弹出框,javascript实现倒计时提示框
  11. 《史蒂夫·乔布斯传》经典语句段落摘录
  12. An End-to-End Steel Surface Defect Detection Approach via Fusing Multiple Hierarchical Features-阅读笔记
  13. html audio缓冲效果实现
  14. 前端 day01 常用基础语法
  15. 智能家居作为物联网领域风口 引科技巨头争夺
  16. 微信公众号 语音转文字api_原来微信不仅能实现语音转文字,还能实现文字转语音!你还不知吗...
  17. ArcGIS pro/ArcGIS 10.6及以上版本的最强工具箱——“WhiteboxTools”(468新功能:GIS分析,水文分析,图像分析,激光雷达分析,数学和统计分析,数据流网络分析和)!
  18. SQL Server修改密码
  19. 【围观】CISP-PTE 考题示例
  20. SAP那些事-职业篇-36-从“固定资产清理”科目说开去

热门文章

  1. linux系统分辨率没有,Linux装完显卡驱动后分辨率无法正常显示怎么办?
  2. java的jvm和事务并发的关系_Java程序员岗面试总结
  3. 公司电脑上怎么固定内网IP地址,不让IP变动
  4. apk获取屏幕分辨率
  5. linux配置i3窗口管理器,i3窗口管理器配置
  6. Nginx做HTTP代理、邮件服务器代理、数据库代理
  7. vue3父组件调用子组件方法
  8. 朋友圈从“三天可见”到“展示半年”
  9. python爬取网页原理_Python:爬虫原理和网页构造
  10. UEFI模式下WIN10+Ubuntu18.04LTS(挂载到固态加机械)双系统安装