I have a range of data in Google Sheets, column A is a list of unique identifiers (eg "ABCD1"), column B is a delimited list of attributes of each (A,B,C...) . I want to produce a list of unique identifiers and every single attribute across 2 columns (for example, ABCD1 A). Please help!
raw data
outcome
try:
=ARRAYFORMULA(SPLIT(A1&"♦"&TRANSPOSE(SPLIT(B1; ",")); "♦"))
Related
I have a table like this one here (basically it's data from a google form with multiple choice answers in column A and B and non-muliple choice data in column C) I need a separate row for each multiple choice answer.
Column A
Column B
Email
A,B
XX,YY
1#gmail.com
A,C
FF,DD
2#gmail.com
I tried to un-nest the first column and keep the remaining columns like this
enter image description here
I tried several approaches I found with flatten and split with array formulas but I don't know where to start really.
Any help or hint would be much appreciated!
You can use the split function on the column A and after that, use the index function. Considering the table, you can use:
=index(split(A2,","),1,1)
The split function separate the text using the delimiter indicated, returning an array with 1 line and 2 columns; the index function will return the first line and the first column from this array. To return the second element from the column A, just change to
=index(split(A2,","),1,2)
I think there's no easy solution for this. You're asking for as many combinations of elements as multiple-choice elections have been made. Any function in Google Sheets has its potentials and limitations about how many elements it can express. One very useful formula here is REDUCE. With REDUCE and sequences of elements separated by commas counted with COUNTA, you can stablish this formula:
=QUERY(REDUCE({"Col A","Col B","Email"},SEQUENCE(COUNTA(A2:A)),LAMBDA(z,c,{z;LAMBDA(ax,bx,
REDUCE({"","",""},SEQUENCE(ax),LAMBDA(w,a,
{w;
REDUCE({"","",""},SEQUENCE(bx),LAMBDA(y,b,
{y;INDEX(SPLIT(INDEX(A2:A,c),","),,a),INDEX(SPLIT(INDEX(B2:B,c),","),,b),INDEX(C2:C,c)}
))})))
(COUNTA(SPLIT(INDEX(A2:A,c),",")),COUNTA(SPLIT(INDEX(B2:B,c),",")))})),
"Where Col1 is not null",1)
Since I had to use a "initial value" in every REDUCE, I then used QUERY to filter the empty values:
I have a spreadsheet where in TAB A I have a database with the "raw" data imported from another db, where I have some products with unique ID's and a few other columns.
What I'm trying to do is on TAB B, using an arrayformula, is count all of the unique numbers for the specific ID, I left an example on TAB B on the top rows using QUERY formula.
here is the spreadsheet link if you wanna take a look at the data: https://docs.google.com/spreadsheets/d/1-pFeQWVD_0fpBdC-GzHBlnr92bGDQn-6kqEdWfTAkPI/edit#gid=487890997
Thanks in advance for the help!!
You can use this QUERY for selecting the UNIQUE values of ID and Product number in B1:
=QUERY(QUERY('TAB A'!A:C;"SELECT A,C,COUNT(B) WHERE A is not null group by A,C");"Select Col1,Col2")
And this MAKEARRAY in D2 for the counts of unique values:
=MAKEARRAY(COUNTA(B2:B);COUNTA(D1:1);LAMBDA(r;c;COUNTA(UNIQUE(FILTER(INDEX('TAB A'!D2:F;;c);'TAB A'!A2:A=INDEX(B2:B;r))))))
I have list of data containing comma separated department wise orders in column-B, which is outlined in a format like:
Order_Num-X1|Dept_Name-Y1,Order_Num-X2|Dept_Name-Y2
and so on...
See the below table:
Is it possible to split and distribute the data in corresponding department column as outlined in Column-C, Column-D, Column-E?
I tried as suggested in this post, But I stuck filtering a separated list stored in a single cell.
Try
=IFERROR(ARRAYFORMULA(query(trim(split(flatten($A$2:$A&"|"&split($B$2:$B,",")),"|")),"select Col2 where Col3='"&C$1&"' and Col1='"&$A2&"' ",0)))
I have put together some sample data in a sheet here.
Essentially I have a column with names separated by a pipe (col B in example). I have a separate table (col F:G) that maps each name to a role type. I want to add a column that looks up each individual person in the pipe delimited string and returns a similarly structured string containing their job roles.
I can do this on a row by row basis (see col C), but this is a table that will grow (and is sourced from elsewhere) so ideally I'd like to use an array formula that will work for every row. However, because of the SPLIT() in there I can't get this to work.
Is there a way I can achieve this?
try:
=ARRAYFORMULA(REGEXREPLACE(REGEXREPLACE(TRIM(FLATTEN(QUERY(TRANSPOSE(
IFERROR(VLOOKUP(SPLIT(B2:B, "|"), {F:F, G:G&"|"}, 2, 0))),,9^9))),
"\|$", ), "\| ", "|"))
How do I create multiple sheets that use a Google sheet named TOTAL as the data source? Each sheet must contain the same three columns from TOTAL and other specific data, for instance, FLUX will have six columns, three from TOTAL and three custom columns added manually.
I used a query function to import the data from TOTAL to FLUX so that updating data in TOTAL will update it also in FLUX
The data in TOTAL are not fixed. It will change adding rows, which might change the order of the list. For instance, adding the row 13 in TOTAL will shift down the data in column A:C in FLUX, but not columns D:F
Is that a way to keep the reference out of the QUERY part?
Here an example: Click me
you would need to create ID system and then you would be able to match your query with rest of the static columns. in sheet SALES remove that query and put IDs in A column. then your query will be:
=QUERY(TOTAL!A1:D, "SELECT A, B, C, D WHERE C is not null", 1)
where column A contains IDs and then you create new sheet SHEET3 and paste this query in A1
and this formula in E1:
=ARRAYFORMULA(IFERROR(VLOOKUP(A1:A, SALES!A1:G, {4,5,6}, 0), ))
I have the same problem and I can't understand few steps from the answer.
Firstly, the A columns of both sheets (TOTAL and SALES) must have IDs?
Secondly, I can't really understand how the Sheets SALES should look like. Should it be like, Col A = IDs, ColB to C query from TOTAL and Col E to G static data?
In this case is it still correct creating a query in Sheet3 reading data from TOTAL?
Thank