Google-Sheet - query multiple unknown sheets? - google-sheets

Context: I need to develop a Google Sheet to manage yearly cost and revenues from the Charity where I volunteer. This file will be updated from volunteers, so I need to develop a structure which they can use with easiness.
My idea:
have a front sheet with a summary from activities and charts
let volunteers duplicate a template event cost and revenue and add their c&r
Result would have as much sheets as many Events and Charity or Fundraising events/campaign.
But, since the number of sheets is unknown till the end of the year, how can I have a summary sheet?
E.G. How can I sum all costs and all rev? Can I query to search in **all existing sheets the cell that follows an exact string (e.g. Total Rev)?**

You can write an Apps Script - a Google Script service based on Javascript
It is relatively simple to learn and use and it will allow you to loop dynamically through all the sheets without knowing in advance how many there will be.
The following sample script iterates through all sheets minus the master sheet of the spreadsheet to which it is bound and sums the values of the cells "A10" (if this is the cell where you have your costs) together. Finally it sets the value of the sum into the cell "A10" fo the master sheet.
function myFunction() {
var ss=SpreadsheetApp.getActiveSpreadsheet();
var sheets=ss.getSheets();
var sum=0;
for (var i=0; i<sheets.length; i++){
if(sheets[i].getName()!="Master"){
var value=sheets[i].getRange("A10").getValue();
sum=sum+value;
}
}
ss.getSheetByName("Master").getRange("A10").setValue(sum);
}
If you take some time to get familiar with Apps Script, you will be able to easily adapt the sample above to your needs.

I would recommend that the volunteers don't fill out anything on the sheet at all.
You can collect all you need from the volunteers via a google Form. That form will dump all the data into a single tab in google sheets from which it will be easy to analyze and summarize the data that you want to see and share with the whole team.

Related

How to add up values in an array if they need to meet numerous criteria

I am building a rudimentary budgeting tool on Google Sheets, where I intent to use a google form to enter new data(Data input sheet). After this I want to sum all expenses up, which timestamps are within the same year and month and have a common category like Technik or Nebenkosten(utility). This sum is supposed to go into a separate spreadsheet. SummaryOfExpenses How can this be made possible
I suggest that you build a pivot table and group the dates by year and monthes.
You can do it into a separate spreadsheet of course.

Can I make Google Sheets evaluate a string input as if it were a formula?

I am creating a home budget for myself in Google Sheets, working in Chrome on Windows 10. In the end, the budget will be composed of separate sheets for each month, containing tables for each Friday (payday) within that month. All such tables will follow a certain format and will pull arrays of budget data from an auxiliary sheet.
However, trial-and-error (mostly error) is abundant, and one quails at the thought of having to paste corrections across 52 tables. Is there any way to have each table emulate a formula set down in a template? For example, ideally, my template would contain something like:
=INDEX(IF(condition(relativeCell),namedRange1,namedRange2)
and the final product would pull that formula (with relative reference) to each table. If I discover a mistake or need to make a change, I can simply change the template, and all of the live tables would update their formulas.
Can this be done in Google Sheets?
Failing that, I already have a function that returns a cell's formula as string text. Can this be used to get the desired effect?
there is a formula called INDIRECT which does exactly that:
https://support.google.com/docs/answer/3093377?hl=en

Using text from a cell in a formula in Google Sheets

I would like to use the text from a cell in a formula in Google Sheets.
I have a document with multiple sheets that a variety of people can edit with a H,M,L (high, medium, low) value from a drop-down list. Each person has their own tab in the Google Sheet.
I then have a dashboard that populates based on their choices of H,M,L. I know that I can use the formula =('Jay Delacruz'!C6) for example to populate a cell in another sheet by manually selecting the cells on the other sheet.
However, I am looking to make quite a few of these documents automatically with another Google Script that I am running that creates the individual sheets from a roster of names on the first tab.
My question is, is it possible to have a =('Jay Delacruz'!C6) type formula that instead of the sheet reference it can pull the name of the person from the roster, as this will match exactly the sheets that are automatically generated by the script I have running.
So I would essentially have a pre-populated dashboard of formulae that would become valid once the sheets are created with the names, as created by the other script.
If it makes it a little clearer, there is a link below to make a copy of the Sheet I am working with. All names were randomly generated, so don't reference any real people or data.
https://docs.google.com/spreadsheets/d/1NiXqko8SibD6VsfrnFcj7e7c99Hg-RoSlHVAYWb0E94/copy
Thank you in advance!
Liam
Try
=INDIRECT(C1&"!C6")
Also see here for more info on INDIRECT() function.

Google Sheets - linking two separate sheets and importing values

I have two spreadsheets:
A budget sheet, with estimated costs and actual costs. Replicated here: https://docs.google.com/spreadsheets/d/1J8wPicVyfs98QXRXRCHZoq-Y6Uoi75Iv8WitGja4Pic/edit#gid=0
A cost tracking sheet, with the actual costs and reference to receipts. Replicated here: https://docs.google.com/spreadsheets/d/1YclB3V3817Q-RGwuzrOXoZkarwFszaTqwUFurtYtLVo/edit#gid=0
Currently I am importing the 'actual costs' in the budget sheet, by referencing rows from the 'actual costs' in the tracking sheet
So my budget sheet references the cost tracking sheet this way:
=(importrange("spreadsheet_key","sheet_name!I76"))
This works fine, however, if I insert a new row into my cost tracking sheet above some of the values I am already referencing, it will not dynamically update.
So if I insert a new row above:
=(importrange("spreadsheet_key","sheet_name!I76"))
I then have to manually change it in the other sheet too for each item:
=(importrange("spreadsheet_key","sheet_name!I77"))
Is anyone aware of a way I can link two sheets and still be able to insert rows without this breaking?
Thanks
Sounds like you want a sheet that updates when new values are entered into a separate sheet? I think a short script similar to the one proposed in this question should work for you.
Detect user inserting row or column in a google spreadsheet and reacting in a script

Automatic data record in Google Sheets

I receive the data on the P/E multiple in Google Sheets via GOOGLEFINANCE in the following manner:
=GOOGLEFINANCE("GOOGL","pe")
How to write script in Google Sheets that would record the P/E values (or better the values of a particular cell) every day as at, say, 21:00?
Use Google Apps Script.
You want to write a function that uses the Spreadsheet API to get the value of a given Range in a given Sheet, and then append that value in a new row on a different sheet.
You also want to set up a time-based trigger to execute that function.
As an example, for a bound script with only one worksheet:
function copyA1toA2onSameSheet() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
sheet.getRange("A2").setValue(
sheet.getRange("A1").getValue()
);
}
Note that getActiveSheet will always return the first sheet from a time-based trigger, as there is no UI instance. If you need a different sheet, consider getSheetByName, or using getSheets().

Resources