I have two Google Sheets: the first contains data per week and the second gives an overview of that data. The sheets in the first are named by week. For example: Week 1, Week 2, Week 3, Week 4 ... The sheets in the second contain one cell which has the same text as the sheet names of the first document. This cell is A1.
Using the IMPORTRANGE function I want to show some data from the first (data) document in the second (overview) document. Currently the IMPORTRANGE formula looks like this:
=IMPORTRANGE("https://docs.google.com/...; "Week 1!C2:C5")
As you can see I have to change the sheet name I reference to manually. I want it to change automatically using the text in cell A1. So it should look like this:
=IMPORTRANGE("https://docs.google.com/...; "A1!C2:C5")
Is it possible to do it like this or do I need a script and how can I make it work?
Thank you for your tip about using ranges, I will use it in the future. You suggested the following formula:
=IMPORTRANGE("https://docs.google.com/...; A1)
It didn't work. I got it to work with the following formula:
=IMPORTRANGE("https://docs.google.com/..."; (A1&"!C2:C5"))
sure, just try it:
=IMPORTRANGE("https://docs.google.com/..., A1)
I also recommemnd you use named ranges (google it). this allows you to just type in "week1" into cell A1, instead of something like "Sheet3!A1:B343." Without named ranges any complex spreadsheet will turn your formulas into an indecipherable mess.
Related
In my data sheet1, I want to use the 'Name in use' column (B) with the last two names with ARRAYFORMULA.
In my data sheet2, I want column (B) to be repeated with the same code next to the column A get filled
Please find the sample date sheet below https://docs.google.com/spreadsheets/d/1_AWRjexJNAcgNGsmrBKU_8JYL03UbAGeiyy4oI8B9fU/edit?usp=sharing
Regards,
Nimal PereraSri Lanka
Sheet 1
Your formula seems fine, just the ArrayFormula() needs tweaking. As noted in the docs, ArrayFormula() takes in a range, rather than a single cell.
You would have to do something like this:
=ARRAYFORMULA(IFERROR(UPPER(TRIM(RIGHT(SUBSTITUTE(A2:A5," ",REPT(" ",60)),120)))))
Essentially you type in the range you'd like it to apply on. So at any moment, instead of selecting a single cell for that row, you select the range. If you'd want to apply it to the entire column, use A2:A. You even did it right on sheet2
Sheet 2
Your names seem to be importing correctly once Sheet1 is done right. To have the same code everywhere, use something like this:
=ARRAYFORMULA(IF(LEN(A2:A),"SSD",""))
I am turning to you today for help with a problem on Google Sheets.
I receive this data from a Google Sheets form: An answer (0 or 1) to 5 different questions.
I would like to calculate in column A (in green) the scores out of 5 for each row, as soon as a new row is added by the form.
I tried to use the ARRAYFORMULA() function but it does the count for all the cells in the range and not just row by row:
Do you have an idea to have a score out of 5 for each line of question and have it apply to the whole file as soon as a new line is added by the Google Form?
Thanks for your help
If you want to use COUNTIF (English correspondance for NB.SI), modify your formula to:
=ARRAYFORMULA(COUNTIF(IF(B1:F=1,ROW(B1:B)), ROW(B1:B)))
or for your regional settings:
=ARRAYFORMULA(NB.SI(IF(B1:F=1,ROW(B1:B)), ROW(B1:B)))
You can get a row-by-row sum with sumif() like this in cell A3:
=arrayformula( sumif( if(column(B3:F), row(B3:F)), row(B3:F), B3:F) )
This formula uses open-ended range references so it will create results all the way down to the end of the sheet. To limit that, use a range reference like B3:F100 instead.
In Google Sheets, I currently have several sheets that represent classes and for example sake, might look like this:
CLASS1:
A1-Tom
A2-Fred
A3-Betty
CLASS2:
A1-Bruce
A2-Jane
A3-Sandy
Then in another sheet, SUMMARY, my goal is to create an overview showing in a "CSV" format by class the names of the students, something like this:
COLUMN_A:
A1: CLASS1
A2: CLASS2
COLUMN_B:
B1: Tom, Fred, Betty
B2: Bruce, Jane, Sandy
I can achieve what I need in column B with static cell references with the following formula:
=TEXTJOIN(", ",TRUE,CLASS1!A1:A3).
However, with that I need to manually change the sheetnames in the formulae (e.g. CLASS1!A1:A3 to CLASS2!A1:A3 and so on), when I'd just like to be able to copy it down, using the values in column A to stand in for the sheetnames.
I'm at the point where I've managed to use the values in column A to return a result based on the location of the first item in the respective sheets as follows:
=TEXTJOIN(", ",TRUE,INDIRECT(ADDRESS(7,1,4,TRUE,$A1)))
However, this obviously only returns the first item in my list. For it to work in the same manner as my static solution above, I need to make it work for a range. And that's where I'm stuck.
Any help would be very much appreciated.
try dragging:
=TEXTJOIN(", ", 1, INDIRECT("CLASS"&ROW(A1)&"!A1:A3"))
The answer is next:
1) There is formula in Google Sheet cell "A11", for example "=F11+C11";
2) I append multiple data to this Google Sheet list with the help of
https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/batchUpdate
or https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append
3) I need to append the value for "A12" using its current position. It had to become "=F12+C12".
Or if I append data on top
(as described here - Google sheets API append method (last on top))
I need that formulas under my append changed to correct value. If current value of "A11" is "=F11+C11" then,
if I add 3 rows before this row, it becomes "A14" cell and it's value had to be changed to "=F14+C14"
Is there any way to realise both this scenarious directly in Google Sheets API request? May be there is some settings in Google Sheet that can help me (something like formating of cells/columns etc)?
UPD. For now it all works fine except of that incident when formula returns exception! My questions is not actual for now, but I still not understand in which cases formulas will change and in which they will not.
The answer is quiet simple!
I update cell 'A13' with formula '=B2+C2' and as cells 'B2' and 'C2' stay on their places after every changes my cell 'A13' still link cells 'B2' and 'C2'.
But if I will add row before 'B2' and/or 'C2' then formula will change and my cell 'A13' will link 'B3' and 'C3'.
I need to do a sheet to managing some informations in my job.
I'd like to make a compilation of informations filtred by month, i.e., I'd like to insert a month (B1 cell) and all the informations would be refreshed by this month.
For while I could manage this data:
Team (Equipe);
Modules (Módulos); and
Type (Tipo).
and my formula is working:
=COUNTIFS(Geral!$B$2:$B$45;$A5;Geral!$C$2:$C$45;$B5;Geral!$E$2:$E$45;C$4).
What I'd like to do is something like this:
=COUNTIFS(Geral!$B$2:$B$45;$A5;Geral!$C$2:$C$45;$B5;Geral!$E$2:$E$45;C$4;Geral!$F$2:$F$45;MONTH(B1)).
I know this formula is wrong, but I don't know how to do this... I've already tried to use arrayformula, but it didn't work...
How do I do this?
Here is the link to the sheet:
https://docs.google.com/spreadsheets/d/1NOkvkJ7B3lGcSaUTtUdrnbmdd8AjiRvniH2lM3kASSU/edit?usp=sharing
Thanks in advance!
I believe what you need is:
=ArrayFormula(COUNTIFS(Geral!$B$2:$B$45;$A5;Geral!$C$2:$C$45;$B5;Geral!$E$2:$E$45;C$4;MONTH(Geral!$F$2:$F$45);B1))
... but beware that date functions in Sheets will read a blank cell as 30/12/1899, therefore MONTH() on a blank cell will return 12. So you might want to include a test to rule out blank-ness:
=ArrayFormula(COUNTIFS(Geral!$B$2:$B$45;$A5;Geral!$C$2:$C$45;$B5;Geral!$E$2:$E$45;C$4;MONTH(Geral!$F$2:$F$45);B1;Geral!$F$2:$F$45;"<>"))