Combining multiple arrays or ranges into one - google-sheets

Does Google Sheets support any way to combine multiple arrays or ranges into one?
I am looking to combine two data ranges when making a call to FREQUENCY function. For example:
=FREQUENCY(B5:F50; I5:I16)
=FREQUENCY(J5:N50; I5:I16)
work great on their own but I would like them to be combined into a single function call. Something like MS Excel equivalent =FREQUENCY((B5:F50, J5:N50), I5:I16).
Of course I can just reshuffle columns where I have both datasets side-by-side to reference them with =FREQUENCY(B5:K50; I5:I16) but I'd rather not.

Something like this should work:
=frequency({B5:F50;J5:N50};I5:I16)

By the looks of it there is no solution to my question. I've tried an array of options that work in MS Excel but Google Spreadsheets seem to be a different animal.
As a solution I had to modify my spreadsheet code display columns from two different datasets side-by-side.

Related

combine data from selected sheets

I have a spreadsheet that has a lot of sheets of data grouped by category. I have a main sheet that I want a user to be able to choose which categories of data to use, and it will pull that data into one long list.
Here is an example spreadsheet of what I want to do: LINK TO SHEET
I could combine all the data into one spreadsheet, but if I were to do that with the dataset I am working with, I would have tens of thousands of rows. So, having the data stored on separate sheets is preferred. I am open to having separate spreadsheets altogether if that will make it easier. Currently, I have tried Using INDIRECT and QUERY, but can only get the first sheet of data to show.
I would prefer to stick to normal functions, but could jump into appscript if I need to create a custom formula
I have tried using INDIRECT and CONCAT, and can get the first set of data, but not subsequent data. Also tried wrapping it in a query like this:
=QUERY({ARRAYFORMULA(INDIRECT(CONCAT(A2:A,"!a2:z100"))},"select * where Col1 is not null",1))
Splitting it up into separate spreadsheets, I was able to use the function:
=QUERY({ARRAYFORMULA(IMPORTRANGE(B2:B,"A1:Z10"))},"select * where Col1 is not null",1)
But it also would only pull the first set of data, not the subsequent rows.
All of this was me first attempting to get the information, not getting the information filtered by the sheets that were checked as well. I am pretty familiar with appscript as well and open to appscript solutions, but would prefer to stay away from it if possible.
You do not need additional column. Use REDUCE() with few other formula-
=REDUCE(HSTACK("Dataset Name","Data 1","Data 2","Data 3","Data 4"),FILTER(A2:A,B2:B=TRUE),
LAMBDA(x,y,VSTACK(x,QUERY(INDIRECT(y&"!A2:E"),"where A is not null"))))

Google data studio - Use multiple datasheet with same data keys/headers

So I've been stuck in this for some days, tryed a lot of search terms but all of them seems to bring me the same answers and i really need this:
I have a demand to join two different company's datas from the same owner, all of them have the same data sources (excel data sheets from FB ADS).
So they all share the same (keys/headers), like this:
COMPANY(1)'S ADS DATA
COMPANY(2)'S ADS DATA
So this way I need to put then togheter without having to join both of then on excel every time and also give him some nice data manipulation power.
The results should be something like this
By now I was trying to join data from the two companys but I couldn't really figure out how to properly do this so far I've made some tests and tryed reading a couple of articles and google data studio's help files. The merging data function seems to mess everything.
As a result of this merge, GDS gives me this fields:
Shouldn't I see like only one field labeled as cnt and cmp? I've noticed that GDS creates not one, but two data fields. If I try adding all data I need as key the left sheet turns all "0s". What Am I doing wrong here?
I have read your descriptions. It seems that you are looking for a solution to append both tables instead of merging the tables.
Do note that the data blending in GDS is a left outer join.
Hence, instead of doing the blending in GDS, I'd suggest you to append both datasets in Google Sheet in a separate tab before importing to GDS for visualisation. (assuming you don't mind copy-pasting the data into the Google Sheet).
Here is the formula to append both datasets in Google Sheets:
= {QUERY(A!A1:D1000,"SELECT A,B,C,D WHERE A <> ''",1);QUERY(B!A2:D, "SELECT A,B,C,D WHERE A <> '' ")}
I've created some dummy data in this google sheets and appended the data using the formula provided , you may take a look to understand further.
If you are unclear on the difference between merge and append, you may take a look in the Google Sheet documentation as well.
On a side note, I've screencast the process of answering this question and posted on my youtube channel. You may take a look if needed. (Thanks for the question and inspiration you provided for the video)

Inverse LOOKUP in google sheets to return column name

Good day,
I am currently sorting a storage unit, where various parts from samples are stored in multiple locations. The idea is to sort it. So I am creating a spreadsheet for each part. The columns will be the location and the rows are a list of the sample numbers of which the parts can be found in this location.
input:
A spreadsheet like this will exist for every part.
The idea is to have a final table, sorted by sample number, which has the parts in the columns. I want the cells to return where this part of this sample is stored:
desired output:
I tried various LOOKUP formulas but they do not return the column name.
Because this has to be accessible by multiple people, it has to be in google sheets.
This is an example file: https://docs.google.com/spreadsheets/d/1pUmTs0mLoZAdPc83pLXC75MCUF2P1SHDtEfYPEMohr4/edit?usp=sharing
I am super thankful for any help!
With the help of this website:
https://infoinspired.com/google-docs/spreadsheet/search-across-columns-and-return-the-header/
I found a solution. The idea is to use match functions for each column. For the example posted the code looks like this:
=ifs(isna(match(A2,'Part 1'!$A$1:$A$7,0))=FALSE,'Part 1'!$A$1,isna(match(A2,'Part 1'!$B$1:$B$7,0))=FALSE,'Part 1'!$B$1,isna(match(A2,'Part 1'!$C$1:$C$7,0))=FALSE,'Part 1'!$C$1,isna(match(A2,'Part 1'!$D$1:$D$7,0))=FALSE,'Part 1'!$D$1)
I know it is not pretty, but it works, as the number of columns is limited. The website also suggests a dynamic solution with a query function, but that only works when the cell left of the cell of interest has entries.
Thanks to everyone :-)

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))

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