Using ARRAYFORMULA with Multiple cell values in to one - google-sheets

Im trying to add few cell values to one separate (Column) Cell with Line brake for each Cell Value.
(Using Google Sheets)
The Formula im Using is
={"ID" ;ARRAYFORMULA(CONCATENATE(H2:H,CHAR(10),I2:I,CHAR(10),J2:J,CHAR(10),K2:K,CHAR(10),L2:L,CHAR(10),M2:M))}
The Issue im facing is all the data is coming on to Cell O2
Please check Image
What I want is for each row to get the values on relevant Column
Thanks in Advance

Alternatively, you can also try in O1
={"ID"; ArrayFormula(substitute(transpose(substitute(trim(query(transpose(substitute(H2:M, " ", "_")),,rows(H2:H))), " ", char(10))), "_"," "))}

I suspect you need this in cell O1:
=ARRAYFORMULA({"ID" ;H2:H&CHAR(10)&I2:I&CHAR(10)&J2:J&CHAR(10)&K2:K&CHAR(10)&L2:L&CHAR(10)&M2:M})
Probably good to add a trim as well:
=ARRAYFORMULA({"ID" ;trim(H2:H&CHAR(10)&I2:I&CHAR(10)&J2:J&CHAR(10)&K2:K&CHAR(10)&L2:L&CHAR(10)&M2:M)})

Related

query not resolving formula

I am trying to concatenate data in QUERY formula from cell as shown in image
(https://i.stack.imgur.com/3EdUX.jpg)
Formula is :=QUERY(CONCATENATE(A9,"!A2:D5"),"Select A,B")
picking data_range from another cell
how can I get it?
picking "data_range" from another cell
I want to "data_range" in query changeable
use:
=QUERY(INDIRECT(A9&"!A2:D5"); "select Col1,Col2"; )

I am looking for a way to =filter and not overwrite data from previous cell

I am trying to create a production order-bill of material master sheet. The issue I am having is when I use =filter to get my bom data I can only do one line item without a #ref error. I am hoping to find a way to =filter then add rows(push down the data) so data does not get overwritten.
This is working when I am only filtering for one line item
The issue comes when I drag the formula down to get the BOM info for ROW 2.
Error when dragging the formula through the sheet
I have highlighted the line item and filter results I am looking for. If anyone has a solution to add X amount of rows based on the filter results that would be great. I am currently at a loss. I have tried for weeks.
https://docs.google.com/spreadsheets/d/1Ubs9nthgk9h-DKxXMVhAjPZF8ot1F98nCcLccLbTbyE/edit?usp=sharing
you could do it like this and drag down:
=ARRAYFORMULA(SUBSTITUTE(SUBSTITUTE(QUERY(FILTER(SUBSTITUTE(BomMaster!$1:$17000, " ", "♦"),
BomMaster!A:A=B2&" "&C2&" "&D2),, 9^9), " ", CHAR(10)), "♦", " "))

Google Sheets formula to leave cell empty based on conditions

I'm having issues with this formula:
=ARRAYFORMULA("WORD"&" "&sheet1!$B$20&" "&'sheet2'!A2:A&" "&sheet1!$B$17&'sheet2'!B2:B)
What I want is to leave empty cell if there is no data available in sheet 2 and when the data is added in the sheet (sheet2) the formula auto populates the results in the third sheet, where the formula is placed.
Tried with If function, but I'm getting Errors.
Thanks in advance for the help.
=ARRAYFORMULA(IF('sheet2'!A2:A="","","WORD"&" "&sheet1!$B$20&" "&'sheet2'!A2:A&" "&sheet1!$B$17&'sheet2'!B2:B))

USING TEXTJOIN AND UNIQUE OVER NON-CONTINUOUS CELLS

OK, relatively simple, but frustrating for me. I think my issue isn't with the TEXTJOIN, but in defining a non-continuous series of cells for the UNIQUE function.
In cell A1, I am using this formula:
=TEXTJOIN("
",UNIQUE(B1,E1,H1,K1,N1))
NOTE: I am trying to do this for a row, and not the entire column that the data is in.
My thought was that it would join only unique values from that series, separated by a hard return.
However, I get an error.
Image of a Google Sheet error with my formula
So, looking for a way to look at a non-continuous series of cells in a row, pull out only unique values, and TEXTJOIN them together with a hard return (new line).
Your formula should be
=textjoin(" ",true,unique({B1;E1;H1;K1;N1}))
encapsulate the cells by {}
try:
=JOIN(" "; UNIQUE({B1;E1;H1;K1;N1})
or:
=QUERY(UNIQUE({B1;E1;H1;K1;N1}),,9^9)

Concatenate merged cells with Google Sheets

I have this situation on Google Sheets:
I want to concatenate (=A2&B2) with a merged cell, but only the first cell has a value. I want to get the values of the column "Expected results". How I can detect the first value of each work office in this example?
You can use INDEX/AGGREGATE:
=INDEX($A$1:$A$9,AGGREGATE(14,4,(ISBLANK($A$1:$A$9)=FALSE)*(ROW($A$1:$A$9)<=ROW())*ROW($A$1:$A$9),1)) & B2
Edit for google sheets:
=INDEX($A$1:$A$9,LARGE((ISBLANK($A$1:$A$9)=FALSE)*(ROW($A$1:$A$9)<=ROW())*ROW($A$1:$A$9),1)) & B2
When merging a cell, the content appears only as if it were if the first cell of that block. Hence, you need to only use that first value as your reference. For this you need to block the reference, and it would look like this:
=($A$1&B2)
You can check more information about that in this link.
Try this in D2:
=ARRAYFORMULA(IF(B2:B="",,VLOOKUP(ROW(A2:A),FILTER({ROW(A2:A),A2:A},A2:A<>""),2)&B2:B))

Resources