我有大约3000列的数据集,但是某些列有几个包含单元格“ na”的单元格。这些行并不重要,因为它们没有我需要的数据,在Google工作表中是否有一个命令可以突出显示包含该文本的整个行或删除包含该文本的整个行?
任何帮助将不胜感激。
https://docs.google.com/spreadsheets/d/1u8OUfQOzgAulf1a8bzQ8SB5sb5Uvb1I4amF5sdGEBlc/edit?usp=sharing
我的文档^。
此答案基于我的理解,如果我错了,抱歉。您可以使用条件格式突出显示所有不适用的文本
这是我使用的规则
以下是其他可能对您有帮助的答案
Delete a row in Google Spreadsheets if value of cell in said row is 0 or blank
Deleting Cells in Google Sheets without removing a whole row
对不起,英语不好。
我不确定我的准备是否很好,但是请参阅下面的说明。这是一个Google脚本功能,可以为“ na”所在的整个列着色。
function myFunction() { //get the spreadsheet where the function is running var ss = SpreadsheetApp.getActive() //Replace "the name of your sheet" by your sheet name" be careful its case sensitive. var sheet = ss.getSheetByName("The name of your sheet") //Get all your data as an array (If your sheet has no header, change 2 by 1 and (sheet.getLastRow()-1) by sheet.getLastRow()) var values = sheet.getRange(2,1,(sheet.getLastRow()-1), sheet.getLastColumn()).getValues(); //For each column for (var i = 0; i< sheet.getLastColumn(); i++){ //using function map is helping to select one column by one column var mapValues = values.map(function(r){return r[i]}); //Searching your keyword in the column, in your case it's "na" var position = mapValues.indexOf("Put the string that you are looking for, in your case 'na'"); //if at least there is one "na" inside the column if( position >-1){ //then this color have to get red color as a background var wholeColumn = sheet.getRange(2,(i+1),(sheet.getLastRow()-1)); wholeColumn.setBackground("red"); } } }``
让我知道是否可行