Dynamic Cell / Column in if formular - google-sheets

I want to build a list with textjoin() in my google sheet, but depending on a certain value in a cell, that will change from time to time.
My formular so far looks like this
=TEXTJOIN(char(10);TRUE;
if(ON10=1;VLOOKUP(P10;rawdata!$B$2:$BX$62;2;false);"");
if(ON11=1;VLOOKUP(P11;rawdata!$B$2:$BX$62;2;false);"");
if(ON12=1;VLOOKUP(P12;rawdata!$B$2:$BX$62;2;false);"");
...
)
that works fine and does what I need, but my problem is, that the cells "ON10" and "ON11" etc will change. It will be "OV10", "PD10" and so on.. so the "gap" or interval will allways be the same.
is there a way to make that part of the formular dynamic?
thanks in advance :)

Reposting comment:
I'd recommend using custom functions to set a dynamic range of columns. You can also read more about Class Sheet to utilize cells depending on the condition (in your case, use getValue to create conditions based on the cell value)

Related

Is there a way to extract individual comma separated values from a cell and populate elsewhere in Google Sheets?

I have a cell on one sheet of a workbook. Values can be separated by lines, or commas, whichever would make this easier.
On another sheet, I would like to display these values in different cells, individually.
Basically I would like to take this:
https://imgur.com/zYLNti2
And have it populate this:
https://imgur.com/a/CVDIuIn
While the code would be nice, I would be happy with the steps I need to take.
I can fairly easily grab the first value out of the cell using:
=LEFT(VLOOKUP(O1,Business!A:N,3),(FIND(",",VLOOKUP(O1,Business!A:N,3),1)-1))
The second is a little more tedious, I've used:
=MID(Q15,FIND(",",Q15)+1,FIND(",",Q15,FIND(",",Q15)+1)-FIND(",",Q15)-1)
Do I have to keep doing the same thing for length -1 essentially? Is there someway to simplify this or make it more dynamic?
Please excuse the sample formula cell references, I know they don't match up with the images provided. Hopefully what I'm asking makes enough sense though.
And I also just found this and it works to extract the value between the second and third comma, but I'm not really sure why it works.
=TRIM(MID(SUBSTITUTE(P16,",",REPT(" ",100)),200,100))
Instead of using Find, Mid, etc. use =transpose(split(your Cell,","))
try in D151:
=INDEX(IFEROR(TRIM(SPLIT(B151:B, ",")&" "&SPLIT(C151:C, ","))))

In Google Sheets, how do I filter based on the value of another cell?

This might seem like a simple question, but I'm really struggling to get it to work. Google Sheets has 'filter by condition', so I'm hoping I can enter the condition of a cell value in order to filter on rows with only that value.
So for example, in a column called Manager, I would like to filter by condition from another tab on cell =Sheet1!A2, where this is the manager name. However, it's only pulling through rows where the cell is blank.
Does anyone know how this could work, or even if it's meant to work the way I would like?
if this is filter view not FILTER formula then you need to use INDIRECT because you refer to value on another sheet. try:
=INDIRECT("Sheet1!A2")

SUMIFS Values from non consecutive Column Cells

I need tu sum several cells that are separated one from another, these cells are
C3,F3,I3,L3,O3,R3,U3,X3,AA3,AD3,AG3,AJ3,AM3,AP3,AS3,AV3,AY3,BB3,BE3,BH3,BK3,BN3,BQ3,BT3,BW3,BZ3,CC3,CF3,CI3,CL3,CO3
if this other cells $C$1,$F$1,$I$1,$L$1,$O$1,$R$1,$U$1,$X$1,$AA$1,$AD$1,$AG$1,$AJ$1,$AM$1,$AP$1,$AS$1,$AV$1,$AY$1,$BB$1,$BE$1,$BH$1,$BK$1,$BN$1,$BQ$1,$BT$1,$BW$1,$BZ$1,$CC$1,$CF$1,$CI$1,$CL$1,$CO$1
that are on the same column but different row are >= to certain number given and <= to other given number, but it returns #Value, can somebody help me find out what am I doing wrong?
This is the function i am writing:
=SUMIFS((C3,F3,I3,L3,O3,R3,U3,X3,AA3,AD3,AG3,AJ3,AM3,AP3,AS3,AV3,AY3,BB3,BE3,BH3,BK3,BN3,BQ3,BT3,BW3,BZ3,CC3,CF3,CI3,CL3,CO3),($C$1,$F$1,$I$1,$L$1,$O$1,$R$1,$U$1,$X$1,$AA$1,$AD$1,$AG$1,$AJ$1,$AM$1,$AP$1,$AS$1,$AV$1,$AY$1,$BB$1,$BE$1,$BH$1,$BK$1,$BN$1,$BQ$1,$BT$1,$BW$1,$BZ$1,$CC$1,$CF$1,$CI$1,$CL$1,$CO$1),">="&B55,($C$1,$F$1,$I$1,$L$1,$O$1,$R$1,$U$1,$X$1,$AA$1,$AD$1,$AG$1,$AJ$1,$AM$1,$AP$1,$AS$1,$AV$1,$AY$1,$BB$1,$BE$1,$BH$1,$BK$1,$BN$1,$BQ$1,$BT$1,$BW$1,$BZ$1,$CC$1,$CF$1,$CI$1,$CL$1,$CO$1),"<="&C55)
I'm not 100% certain, but it looks like the problem here is that SUMIFS requires arguments to be expressed in continuous-range form, e.g. A3:CO3. It looks like you're trying to work with every third column in the dataset, yes? As far as I can tell, this is best (only?) done as an array function, so that you can tell it to filter on "every third column."
Enter this in the cell, then press CTRL+SHIFT+Enter (CSE) to evaluate it as an array function:
=SUM(($A$1:$CO$1>=B55)*($A$1:$CO$1<=C55)*(MOD(COLUMN(A3:CO3),3)=0)*(A3:CO3))
You'll also need to hit CSE every time you evaluate or change it. There's a decent tutorial for array functions at https://support.office.com/en-za/article/Guidelines-and-examples-of-array-formulas-7d94a64e-3ff3-4686-9372-ecfd5caa57c7, which may help if you're unfamiliar with them.

Google Spreadsheets : how do i manage the automatic increment when extending formula to other cells?

I have, I hope at least, a very simple question.
I have a simple sheet with the 3 first columns being a table of results, and a bunch of options that I can fill in some columns on the right. Obviously, the values in the table are supposed to change when I change the different options.
The formulas are very simple : =B2+F9 (each value in the table is based on the previous entry, the first one being specified in the options.
When I select the cell, grab the little square on its bottom right and drag it down it generates something like this :
=B2+F9
=B3+F10
=B4+F11
=B5+F12
It's basically incrementing each reference... wich is the probem I face as the F9 reference is an option and should not change.
What I want basically is something like :
=B2+F9
=B3+F9
=B4+F9
=B5+F9
Thus incrementing the B column, but not the F9 cell.
I tried to "hard-write" some of the first cells, kind of telling him "keep this F9" but without any success :(
How am I supposed to do this ? :'(
Use absolute references for that. In your case, you'd have the following:
=B2+F$9
The $ symbol means that the row is absolute, and should not change when you extend the formula. So, it would generate:
=B2+F$9
=B3+F$9
=B4+F$9
...
If you want the column to be fixed, you can reference it like $B2, for example. And if both the column and the row must be fixed, you'd use $B$2 syntax.

Google Spreadsheet range names

In Google Docs Spreadsheets, one can use Range Names to put labels on ranges of cells to make formulas more legible. In most formulas, one can use the range C:C to denote the entire C column, and C2:C to denote the entire C column after and including C2.
Is there a way to create range names of the same nature? When I try C:C or C2:C or Sheet!C:C or 'Sheet'!C:C I always get the error "The range you specified is not in a valid range format." I would like the range name to expand as my form adds rows to my spreadsheet. Thanks.
I just discovered the if you use the '-' operator, it starts from the bottom row. So,
=INDIRECT("-D:D12")
starts from the last row and works it's way up to D12!
I had a similar problem. Although I do not know how to do exactly what you are asking, you can do essentially the same thing by referencing cells that are not yet created.
For example:
Column C currently has 100 cells (100 rows in the sheet)
Instead of referencing it with C:C, use C1:C999
If you make the row reference high enough, then you can account for future rows that you will create. Hope it helps.
I don't think so... even if you select a column manually while in the Range Name selector, it complains. That would be a nice feature and it would make sense since they support column ranges for formulas already.
I believe this does work now. I have a range name of "Sheet1!A10:AW10" with no problems.
If you try to do a whole column, I think it will just take all the available cells in the column at that time. i.e. if you make more cells later, you need to manually add to the range name.
I had the same problem with ranges such as A3:A which normally work in other places such as ARRAYFORMULA(), but the workaround is to not specify the starting row, such as A:A. In cases when this would be a problem, you can proxy the data through another column using something like ARRAYFORUMULA(A25:A) as the formula.
Update: Apparently I haven't read the question properly. I see that the OP had tried leaving out the row number, so perhaps it wasn't working at that time, but it does now. The notations still don't work.
Update2: I didn't notice that google spreadsheet replaces ranges like A:A to A1:A50, so new rows added later on do not still get included. That I think is what #Dean is trying to say in his answer.
I think it's a helpful tool to use Insert -> Define new range to make a wizard appear and make the syntax correct. Hehe
My response in other topic

Resources