I am trying to nest the following two formulas, both work.
cell AO2 = Bob, cell AP2 = Judy
=TEXTJOIN(\"|\", True, AO2, AP2) = Bob|Judy
=SUBSTITUTE(ADDRESS(1,MATCH("*sumAppTags",Elements!A1:BB1,0),4),1,"") = Column Index AO
If I try:
=TEXTJOIN("|", True, SUBSTITUTE(ADDRESS(1,MATCH("*sumAppTags",Elements!A1:BB1,0),4),1,"")&2, AP2)
I get: AO2|Judy
Is there a way to get this to work?
try:
=TEXTJOIN("|", 1, INDIRECT(SUBSTITUTE(ADDRESS(1,
MATCH("*sumAppTags", Elements!A1:BB1, 0), 4), 1, )&2), AP2)
Related
I would like this multiple-criteria query not to show empty columns.
=QUERY({H3:M11}, "select * WHERE
"&TEXTJOIN(" and ", 1,
IF(C3<>"", "Col2 = "&C3&"", ),
IF(B3<>"", "Col3 = '"&B3&"'", )), 1)
Besides, I would also like to know if it's possible to filter it outside a query formula. Currently, I have this formula made by #player0 which is excluding columns with values greater than 0, but I didn't manage to make it work for text.
=FILTER(FILTER(H3:M11, LEN(TRIM(QUERY(IFERROR(1/(1/H4:M11)),,9^9)))>0), {9;
LEN(TRIM(FLATTEN(QUERY(TRANSPOSE(IFERROR(1/(1/H4:M11))),,9^9))))}>0)
Link to the question where this filter formula was found.
Here's the sheet.
Thanks a lot.
try:
=ARRAYFORMULA(QUERY({H3:K11,
FILTER(L3:M11, TRIM(QUERY(L4:M11,,9^9))<>"")},
"where "&TEXTJOIN(" and ", 1,
IF(C3<>"", "Col2 = "&C3&"", ),
IF(B3<>"", "Col3 = '"&B3&"'", )), 1))
I have a Google Sheet that imports column "L" from another file based on the row number
=ArrayFormula(
IF(LEN(K:K),
if( ROW(L:L) = 1,
"Date",
IMPORTRANGE("https://docs.google.com/spreadsheets/d/123456123456lkjjj","Sheet1!D" & M1:M)
),""
)
)
other file (Sheet1)
The problem always return the first result
Try this:
=ARRAYFORMULA(
IFS(
ROW(L:L) = 1,
"Date",
K:K = "",,
True,
IFNA(VLOOKUP(
M:M,
{
SEQUENCE(ROWS(IMPORTRANGE("https://docs.google.com/spreadsheets/d/123456123456lkjjj", "Sheet1!D:D"))),
IMPORTRANGE("https://docs.google.com/spreadsheets/d/123456123456lkjjj", "Sheet1!D:D")
},
2,
))
)
)
IMPORTRANGE works once inside ARRAYFORMULA, so it is not possible to call it in a loop. But you can get everything with it and then loop through it.
I'm trying to create a column containing a category based on a set of categories and a match/regex string from another range. My example is:
I can't find any answered questions here which explain to me how this can be done, if it can. So am asking here if anyone can help or point me toward an answer I've probably missed!
Neither the category or data ranges will be a static number of rows. I'd like to have a formula which simply produces something like this:
Any help very much appreciated!
try:
=ARRAYFORMULA(IFNA(REGEXEXTRACT(E2:E, "["&TEXTJOIN( , 1, B2:B)&"]")))
update 1:
=INDEX(IFNA(REGEXEXTRACT(E2:E, "["&TEXTJOIN( , 1,
REGEXREPLACE(C2:C, "[\.\*]", ))&"]")))
or:
=INDEX(IFNA(VLOOKUP(IFNA(REGEXEXTRACT(E2:E, "["&TEXTJOIN( , 1,
REGEXREPLACE(C2:C, "[\.\*]", ))&"]")), {
REGEXREPLACE(C2:C, "[\.\*]", ), B2:B}, 2, 0)))
update 2
first of all, learn your regex: https://github.com/google/re2/wiki/Syntax
change your C column to:
.*(A).*
.*(B).*
.*(C).*
then use:
=ARRAYFORMULA(IFNA(VLOOKUP(TRIM(FLATTEN(QUERY(TRANSPOSE(
IFNA(REGEXEXTRACT(E3:E, TEXTJOIN("|", 1, C3:C)))),,9^9))), {
IFNA(REGEXEXTRACT(C3:C, TEXTJOIN("|", 1, TRIM(FLATTEN(QUERY(TRANSPOSE(
IFNA(REGEXEXTRACT(E3:E, TEXTJOIN("|", 1, C3:C)))),,9^9)))))), B3:B}, 2, 0)))
or shorter:
=INDEX(IFNA(VLOOKUP(
IFNA(REGEXEXTRACT(E3:E, "["&TEXTJOIN("|", 1, C3:C)&"]")), {
IFNA(REGEXEXTRACT(C3:C, TEXTJOIN("|", 1,
IFNA(REGEXEXTRACT(E3:E, "["&TEXTJOIN("|", 1, C3:C)&"]"))))), B3:B}, 2, 0)))
I have a google sheet with 3 tabs. I want to have tab3 pull all rows from tab1 (southware) into tab3 if there is a match to any value on tab2 (Top)column B
=query(southware!B3:AA,"SELECT * WHERE I = '"&Top!B3&"' and D='112'", 0)
I can get it to pull all the rows for only 1 cell on tab2- how do I make it evaluate all the values in column B on tab2
See if this helps
=query(southware!B3:AA,"SELECT * WHERE I matches '"&TEXTJOIN("|", 1, Top!B3:B)&"' and D='112'", 0)
QUERY is not able to work with arrays that's why you will need to use FILTER:
=FILTER(southware!B3:AA, I3:I = Top!B3:B,
D3:D = "112")
but this will may have few limitations, so in such case use this one:
=QUERY(ARRAYFORMULA(VLOOKUP(Top!B3:B,
{southware!I3:I, southware!B3:AA},
{2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27}, 0)),
"where Col3='112'", 0)
Ok, so I'm looking to quickly generate a rather large table. Something that would look like this:
table{
{1, 1, 1, 1},
{1, 1, 1, 1},
{1, 1, 1, 1},
}
Only the table would contain far more rows, and far more values in those rows. I know using table.insert() I can easily add however many I need to a single row, but is there anyway I can also add whole new rows without typing it all out?
Use a for loop.
t = { }
for i = 1,100 do
table.insert(t, i) -- insert numbers from 1 to 100 into t
end
2D arrays are also very simple
t = { }
for row = 1,20 do
table.insert(t, { }) -- insert new row
for column = 1,20 do
table.insert(t[row], "your value here")
end
end
You could remember current row as in local current_row = t[row], but don't try these things to improve performance until you profile! Use them merely for readability, if you think it clearer expresses the purpose.
Also note that (and it's especially funky in 5.1 and newer with the #) you can just directly assing values to nonexisting indices, and they will be added.
You don't need to use table.insert:
t = {}
for row = 1,20 do
t[row] = {}
for column = 1,20 do
t[row][column]= "your value here"
end
end