How to count the number of cells which contain specific text using Google sheet scripts?
Currently I\'am using the following script to count the number of cells which co
Use TextFinder class.
/**
* @customfunction
* @return count of given text in spreadsheet
* @param {string} text text to search
* @param {boolean} mec whether to match entire cell
* @param {boolean} mc whether to match case
*/
function COUNT_SS(text = 'NOT COMPLETE', mec = true, mc = true) {
return SpreadsheetApp.getActive()
.createTextFinder(text)
.matchEntireCell(mec)
.matchCase(mc)
.findAll()
.length;
}
=COUNT_SS()