Hi Damian,
My solution would not be to use a script at all, this can be done easily using the standard functions in the master sheet
Depending on how many "multiple" spreadsheets you have (there's a maximum number of linked sheets - want to say around 200, but could be wrong there), I would probably do the following.
In the Master sheet - have one tab with a row for each "sub sheet"
- First column would be the URL of the sub sheet
- Second column would have the name of the tab in the subsheet with the timestamp column assuming ColA (exclude header row)- e.g. ="'Form Responses'!A2:A"
- Third Column, Row 2 for example would have a function like
- "=INDEX(QUERY(IMPORTRANGE(A2,B2),"SELECT COUNT(Col1),MAX(Col1) WHERE Col1 is not null LABEL COUNT(Col1) '',MAX(Col1) ' ',0),2)
- The first time you use this you'll have to enable the importrange to access the remote sheet - but hover and click allow
- Explanation of formula - working from inside out:
- ImportRange - goes and gets the information in the timestamp column of the referenced sheet
- Query - uses this information to count the number of records returned that are not blank in the first column, and the maximum value of the data in the column in the second
- LABEL is required because Query has the annoying habit of adding in a second header row for max and count columns - this sets the value to a blank space (not strictly necessary here because of...
- INDEX - removes that extra header row by only retrieving the second row
I really hope that this makes sense to you - I think it should pretty much work for you - and it's dynamic, will update when the underlying data updates (you can change the frequency of checking I believe by changing the master sheet properties)
Laurie