(Due to my organization policies I cannot share a sample sheet.)
I have two sheets with data like so:
Sheet1
Sheet2
Now, in Sheet1, in column C, I am looking for an ARRAYFORMULA
that will look up the value in Sheet1!A:A
by matching the substring in Sheet2!A:A
after removing the spaces from Sheet2!A:A
and then returning the value from the row in Sheet2!B:B
.
I came up with a non-ARRAYFORMULA
formula to get the data per-row (in Sheet1!C:C
below). But my real data-sets have thousands of rows and I don't want to have to copy/paste a formula into each one.
Each row has a formula that looks like so:
=TEXTJOIN(
", "
, TRUE
, IFNA(
FILTER(
Sheet2!B:B
, Sheet2!B:B <> ""
, Sheet2!A:A <> ""
, NOT(
ISERROR(
SEARCH(
REGEXREPLACE(Sheet2!A:A, " ", "")
, A2
)
)
)
)
, "not found"
)
)
I tried to convert this to an ARRAYFORMULA
in Sheet1!B2
but it doesn't yield the expected result. The formula is:
=ArrayFormula(
TEXTJOIN(
", "
, TRUE
, IFNA(
FILTER(
Sheet2!B:B
, Sheet2!B:B <> ""
, Sheet2!A:A <> ""
, NOT(
ISERROR(
SEARCH(
REGEXREPLACE(Sheet2!A:A, " ", "")
, A2:A
)
)
)
)
, "not found"
)
)
)