Import multiple ranges from one Google Sheet into another - google-sheets

I am trying to import multiple sheets in one Google Sheet into another Google workbook. I can get ImportRange to work for one sheet but how do I use it for multiple sheets, or alternatively, how do I combine multiple ImportSheets in one column?
=unique(
importrange("https://docs.google.com/spreadsheets/d/...",
"'Kramerville KH'!d5:o1000"))
I want to be able to add another range to that, e.g. 'Emalahleni KH'!d5: o1000.

Use formula:
={unique(importrange("link...","'Sheet1'!d5:o1000"));
unique(importrange("link...","'Sheet2'!d5:o1000"))}
The result is two imports one behind another, see more info here.
There's no better way to do this. Alternative is to combine formula as text and then convert string into furmula using script. See how in this question.

Although the existing answer has been accepted the question appears to require exclusion of duplicates not only from within each range but also across ranges:
=unique({unique(importrange(" l i n k ","'Kramerville KH'!d5:o1000"));unique(importrange(" l i n k ","'Emalahleni KH'!d5:o1000"))})

Related

Use range of sheet IDs in import range

Is there a formula that will allow me to use a range of sheet ids to stack import ranges from multiple sheets?
Example
=importrange(A2:A,"Sheet1!A:F") in the example is meant to be illustrative of what I'm trying to achieve.
I'm aware I can use
={IMPORTRANGE("id1","Sheet1!A:F");IMPORTRANGE("id2","Sheet1!A:F"); IMPORTRANGE("id3","Sheet1!A:F")}
however, what I'm hoping to achieve is a growing list of ids in column A that when a new id is entered (and after creating a method for allowing permissions) will add on and expand the stack of importranges.
The closest I got was this but I'm getting a space on either side of the id and wasn't able to progress from there.
not possible to accomplish directly. the best you can do is to use a formula to generate formula:
=INDEX({""; "={"&TEXTJOIN("; ", 1, "IMPORTRANGE("""&
FILTER(A2:A, A2:A<>"")&""", ""Sheet1!A:F"")")&"}"})

How can I concatenate and transpose two ranges of cells in Google Sheets?

I have a Google Form linked to a Google Sheet. It has a number of questions with responses that I need grouped into specific columns. I also need to keep the columns in the order they're in.
I was working with a formula someone helped me with to do one single range:
=ARRAYFORMULA({"Job Responsibilities";IF(A2:A="",,TRIM(TRANSPOSE(QUERY(TRANSPOSE(H2:V),,100))))})
However in the instance I am having problems, I need to group together the answers that are in columns W - AK and also BA - BO into one cell.
I tried something like
=ARRAYFORMULA({"Supporting SAP Stream";IF(B2:B="",,TRIM(TRANSPOSE(QUERY(TRANSPOSE(W2:AK)TRANSPOSE(BA2:BO),,100))))})
or
=ARRAYFORMULA({"Supporting SAP Stream";IF(B2:B="",,TRIM(TRANSPOSE(QUERY(TRANSPOSE(W2:AK, BA2:BO),,100))))})
But that makes an error.
Is there another modification I can make to concatenate and transpose the values in these cells?
Here is a link to a Google Sheet showing most of what I'm referring to. It's from an earlier iteration, so it's not 100% exact with what I said above, but the goal is still the same. In this Sheet, I would like to concatenate what's in Columns U - AG and AU - BF.
Update, based on the data in your sheet:
=ARRAYFORMULA({"Supporting SAP Stream";IF(B2:B="",,TRIM(TRANSPOSE(QUERY({TRANSPOSE(U2:AG);TRANSPOSE(AU2:BG)},,100))))})
Try:
=ARRAYFORMULA({"Supporting SAP Stream";IF(!B2:B="",,TRIM(TRANSPOSE(QUERY({TRANSPOSE(W2:AK); TRANSPOSE(BA2:BO)},,100))))})

Create a combined list from two separate lists

I'm using Google Sheets to create a product list which combines two sets of data. I'm wondering if there is a function which will effectively create a list which is a product of the two individual lists.
I can achieve this in a number of ways such as creating an array and then using an offset calculation which I copy down the output column but I'm hoping to find a solution which will take the two lists as arrays and output all of the combinations.
I'm wanting to do it this way because the list lengths are dynamic.
I've looked at ={list_1;list_2} but this just placed the second list under the first list, but it does it as a single cell function.
I've created a spreadsheet which illustrates what I'm trying to achieve and what I've managed to achieve so far...
https://docs.google.com/spreadsheets/d/1Q3lexm06utmI1IE2HmjtNjBKHZc771KVNp1dDjL3jxs/edit?usp=sharing
If your lists are in A and B columns, put this in the C column and copy down until the length of the product of the two list lengths.
=CONCAT(INDEX(A:A,INT((ROW()-1)/COUNT(B:B))+1),INDEX(B:B,MOD(ROW()-1,COUNT(B:B))+1))
I suppose you could throw in some logic that hides the output if you go too far and then just fill the whole column.
This is adapted from here.
I found the answer elsewhere on stackoverflow.com.
The answer is:
=ArrayFormula(transpose(split(rept(concatenate(A2:A&char(9)),counta(B2:B)),char(9)))&" "&transpose(split(concatenate(rept(B2:B&char(9),counta(A2:A))),char(9))) )
and I found it here
Generate all possible combinations for Columns in Google SpreadSheets
wrap it into SUBSTITUTE to get rid of that space:
=ARRAYFORMULA(SUBSTITUTE(
TRANSPOSE(SPLIT(REPT(CONCATENATE(A3:A&CHAR(9)),COUNTA(B3:B)),CHAR(9)))&" "&
TRANSPOSE(SPLIT(CONCATENATE(REPT(B3:B&CHAR(9),COUNTA(A3:A))),CHAR(9)))," ",""))
and to sort it use:
=ARRAYFORMULA(SORT(SUBSTITUTE(
TRANSPOSE(SPLIT(REPT(CONCATENATE(A3:A&CHAR(9)),COUNTA(B3:B)),CHAR(9)))&" "&
TRANSPOSE(SPLIT(CONCATENATE(REPT(B3:B&CHAR(9),COUNTA(A3:A))),CHAR(9)))," ",""),1,1))

Count the number of occurrences of a value on a multi-page spreadsheet

The spreadsheet has many pages and more pages will be added in the future and I don't know the names of these future added. I can't just do:
=countif(Tab1!A:Z,Value1)+countif(Tab2!A:Z,Value1)+countif(Tab3!A:Z,Value1)...
because I don't know the names of these tabs to be added.
Is there a way to count the occurrences on new sheets without explicitly adding them in such a formula?
It seems that this can not be achieved using a formula. It must be written as a script. You can see an example at this question: COUNTIF Statements: Range Across All Sheets + Cell Reference as Criterion
I'm not sure if what you're trying to do is possible. But, I can help you with the getting the spreadsheet pages/sheets name part.
By using this sheets projection:
https://spreadsheets.google.com/feeds/worksheets/{spreadsheetId}/public/basic
you'll be able to get the list of all spreadsheet pages in xml format.

What's the right tool for this job?

Is it possible to nest simple programs within a Google Sheets, similar to how you would with Visual Basic for Applications in Excel? Or alternatively a simple = syntax using regex, if there is a way to do that in Google Sheets?
I want to take a list of multiple names (name1, name2, name3) in a single cell from across multiple identical sheets and transpose them to another sheet within the same spreadsheet, check for duplicates and ignore capitals, etc. Is there a way to do this?
You are asking for an easy answer to a composite problem. To solve this, I would split the job into separate chunks:
Split the input cell content into
different cells. As it is unclear
how this format is, I cannot advice
on any specific method. Check out
ImportRange function or similar.
Transpose them. use =TRANSPOSE(area)
Remova duplicates, use =UNIQUE(area)
Check the Google Spreadsheet function list for details.
Nest them: =UNIQUE(TRANSPOSE(A1:C15)).
LOWER cannot be used in this nest as it works with only text input, not array input. Although you can use it for the first input cell.

Resources