there are some sheets in my spreadsheet and I want find how many times I use importrange function to know every connection in my active spreadsheet. Is there a formula to find this values?
Count importrange in all of the sheets in a spreadsheet.
function countImportRange() {
const ss = SpreadsheetApp.getActive();
const n = ss.getSheets().reduce((a,sh,i) => {
a += sh.getValues().flat().filter(e => e.toString().toLowerCase().includes('importrange')).filter(e => e).length;
return a;
},0);
Logger.log(n);
}