Reference all tabs with a specific word in COUNTIF statement

by TheMrIggs   Last Updated April 12, 2019 01:03 AM - source

Basically, I am trying to make a master tab that adds up all of the data from all the other tabs. These tabs are weekly breakdown numbers for ad statistic numbers, so there is a new tab added every week. Here is what every tab looks like. enter image description here The only option I have in mind to accomplish this is adding the new tab name to the formula (to be written) every time I create a new tab. However, I am wondering if there is a way to reference all tabs that contain a hyphen "-" because they are all titled with a date range separated by a hyphen. Is there any way to achieve this? Maybe even with some sort of helper column on the to-be-created master tab?



Answers 1


function SHEETLIST() {
try {
  var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets()
  var out = new Array( sheets.length+1 ) ;
  out[0] = [ "NAME" , "#GID" ];
  for (var i = 1 ; i < sheets.length+1 ; i++ ) out[i] = 
  [sheets[i-1].getName() , sheets[i-1].getSheetId() ];
  return out
}
catch( err ) {
  return "#ERROR!" 
}}

=QUERY(SHEETLIST(TODAY()), "select Col1 where Col1 contains '-'", 0)

0

user0
user0
April 11, 2019 22:28 PM

Related Questions



IF and THEN statements on spreadsheets using color

Updated April 23, 2019 22:03 PM


Excel function: IF, AND, ISDATE, THEN

Updated August 15, 2018 05:03 AM

How to format the time in this Google Docs script

Updated July 12, 2018 14:03 PM