Create 3 output results (rows) from one cell (Google Sheets)? - google-sheets

I found an issue, and I do not know if the title explains it precisely, but I somehow need to create 3 different output results (rows) based on the value in one;
I want to only enter one value in cells A2, A3, A4 (maybe have the cells merged?), the same in B2, B3, B4; C2, C3, C4 and D2, D3, D4. But in column E I need 3 output results for one value in B2.
What would be the most efficient way to do that?
Here is the sheet that I am working on:
https://docs.google.com/spreadsheets/d/1PYPjFr3Ny_ycDJ0PEgdd3y7VAW6J32RGtqqPLDIyXQ4/edit?usp=sharing
How can I do that with one formula based on value in B2 I will get 3 output results in column E that will concatenate string "MO_MED_" with B2 and add different endings _EDITABLE, _REQUIRED, _VISIBLE?

Just to make an explicit answer, the correct way to proceed here would be to use the CONCATENATE.

Related

Run filter in each row dynamically

I'm trying to manage a dynamic set of data over the course of several steps, and at each step I need to remove a specific value from each row, and shift the remaining values to the left to fill in any blanks.
I know I can use
=arrayformula(if(range=value, "", range))
to remove the specific value, but I've only been able to find
=filter(row, row<>"")
to fill in the blanks, but since the number of rows changes, this isn't going to work.
Edit:
I want to turn something like this
Column A
Column B
Column C
Data A1
Data B1
Data C1
Data A2
Data B2
Data C2
Data A3
Data B3
Data C3
Data A4
Data B4
Data C4
etc
etc
etc
to this
Column A
Column B
Column C
Data A1
Data C1
Data A2
Data B2
Data C2
Data B3
Data C3
Data C4
etc
etc
etc
Since I only know how many columns there are, I can only pre-set the formula to filter each column, which moves data vertically. I want to move it horizontally, but where the number of rows is variable, I can't manually pre-set each row to use filter.
Solution: applying FILTER() in combination with BYROW(). Because Google's BYROW() is unfortunately limited to a single value return from it's LAMBDA(), we have to rely on the old ARRAYFORMULA/JOIN/SPLIT trick.
=arrayformula(
split(
byrow(A1:C4,
lambda(row,
ifna(
join(",",
filter(row, row<>"A")),
""))),
","))
As of today (23-Jan-2023), it appears that Google has updated the BYROW/BYCOL functions to allow the return of an array result per row/column, so the answer to the OPs question could now simply be =byrow(range,lambda(row,filter(row,row<>""))).
I have not seen this documented anywhere, and the help pages for the BYROW & BYCOL functions still state that only a single value per row/column is allowed.
Slightly off-topic, but I can also confirm that you can pass the individual row/columns from a BYROW/BYCOL into the other LHFs as well (e.g. a SCAN within a BYROW to give a row-wise running total, etc.)

Google sheets fill in the gaps using array formula

I have this table and the date column has some blanks if the dates are the same.
i.e. B3:B6 are all 31/01/2022
I want to use column F to fill in the gaps.
I would like to use an arrayformula in cell F2 and it stops when the relative A is empty
i.e. if A279 is empty, F279 is empty too.
I tried to do it using a non-array solution
=IF(B2="",F1,B2)
and I cannot change it to array one
=ArrayFormula(IF(B2:B="",F1,B2:B))
I don't know how to make F1 dynamic and the row number is always one less then B, like showing F2 if B3, F3 if B4
This is the Sheet
Try in F2
=ArrayFormula(lookup(row(A2:A),row(A2:A)/--(B2:B<>""),B2:B))
or (better) in F1
={"Date";ArrayFormula(if(A2:A="",,lookup(row(A2:A),row(A2:A)/--(B2:B<>""),B2:B)))}
to understand how it works, pls fill for instance in I2 =arrayformula(if(A2:A="",,row(A2:A)/--(B2:B<>""))) ... if Bx is blank, we get an error, in that case lookup will take the previous value without error.

Let user input a value in a cell containing a formula

I have a table that looks like this:
I'm not very familiar with google sheets yet, and I am looking for a way to allow users to input a value in one of the 4 cells containing a formula. Then the other cells would update according to the value the user entered in the cell he chose.
So if a user enters a value in B2 : B3 B4 and B5 would run the formula according to B2's value. And if then if he chooses to enter another value for B4 : B2 B3 and B5 would update accordingly.
I am not sure if what I have in mind is the correct way to do this, or if it is even possible at all. Any ideas on how to proceed?
I just answer according to my understanding, maybe I'm wrong to understand. I think you just paste your formula's in column c and allow your users to put values in B column, this is the way formula do automatic it for you. Sorry for bad English
I mean to put this in column c =B4/4 like bellow
and you get result like bellow
if you want to have custom inputs for values B2, B3, B4, B5 populate these cells with numbers and put your formulas in C column:
if you want to have custom inputs for values 4, 60, 30 then do it like this:

Formula for getting specific rows from other sheets when using IMPORTRANGE()

I'm using IMPORTRANGE() to get values from another sheet. I'm trying to find a formula that I can use for every row without having to type it in individually to get the following result:
For example, in row C3 I want to get the value for G2 from the other sheet. Right now my formula is:
=IMPORTRANGE("16l-7o_K4DMv5QM8KEKA57l_Eqd7nDXEHKHUY7l5jx9Q","G2")
C4 uses "G3", etc. Is there a way to specify that the value will always be "G" + (the current row + 1)? So C3 gets G2, C4 gets G3, etc.?
specify that the value will always be "G" + (the current row + 1)?
=INDIRECT("G"&ROW()+1)
so C3 gets G2, C4 gets G3, etc.
=INDIRECT("G"&ROW()-1)
I'm using IMPORTRANGE() to get values from another sheet
=IMPORTRANGE("16l-7o_K4DMv5QM8KEKA57l_Eqd7nDXEHKHUY7l5jx9Q", "Sheet1!G"&ROW()-1)
Sorry for the hassle - this is what I need:
CONCAT("G", (ROW() - 1)))

Formula to give itemized sum

I have the following sheet (link). What formula would yield the itemized sums in B2, C2, and D2?
To calculate the value in B2, the formula should check cells B5:B10 and sum the corresponding values from A5:A10 for non-blank cells. Hence: 30+45+30=105.
I have tried ARRAYFORMULA(IF(B5:B10 != ""), sum(A5:A10)) which results in Formula parse error.
Considering that the numbers in column B are not to used (thats what i figured out from your example).
you can use sumIf:
=SUMIF(B5:B10,">0",A5:A10)
so this will check if the cell in column B is greater than 0, then it will add its corresponding value from column A.
please note that if you put a character in the B column the SUMIF will not consider it because we are using ">0" as criterion, instead use ISBLANK.
hope it helps.

Resources