Oct 07 2023 02:22 PM - edited Oct 07 2023 09:03 PM
Hi all,
I've been working on a formula for several days now but haven't been able to fully figure it out.
ChatGPT helped me get to this point but it can't figure out how to completely solve the following problem.
I'm attempting to search and find exact matches and return the cell number (only searching the A columns). Currently the formula below works but doesn't return multiple exact matches, only the first one.
The following formula works but only returns 1 match:
=IFERROR($F5&": "&TEXTJOIN("; ", TRUE, IF(XMATCH($G$5, INDIRECT("'"&$F5&"'!A:A"), 0), "A"&XMATCH($G$5, INDIRECT("'"&$F5&"'!A:A"), 0)&" - "& $G$5&"; ", "")), $F5&": N/A")
What I'm attempting to do is have it return multiple matches, one after the other, seperated by a "; ".
$F5 = worksheet name
$G$5 = exact search phrase
And again, I'm only searching the A column for potential matches. How can we edit this formula to accommodate multiple matches? I should also mention that I'm using a mobile tablet version of excel, so we cant use vba or macros or arrays or what have you. Please help! Thank you!
Oct 07 2023 03:11 PM
=F5&": "&TEXTJOIN(",",,BYROW(INDIRECT("'"&$F5&"'!A:A"),
LAMBDA(v,IF(v=$G$5,"A"&CELL("row",v),""))))&" - "&$G$5
This returns the intended result in my sheet if i correctly understand what you want to do.
Oct 07 2023 03:17 PM
Oct 07 2023 03:36 PM
Oct 07 2023 07:11 PM
Oct 07 2023 08:56 PM
Oct 07 2023 09:01 PM
Oct 08 2023 12:30 AM
Oct 08 2023 01:14 AM
=F5&": "&TEXTJOIN(";",,IF(SUM(LEN(BYROW(INDIRECT("'"&$F5&"'!A:A"),
LAMBDA(v,IF(v=$G$5,"A"&CELL("row",v),"")))))=0,"NA",BYROW(INDIRECT("'"&$F5&"'!A:A"),
LAMBDA(v,IF(v=$G$5,"A"&CELL("row",v),"")))))&" - "&$G$5
You are welcome. This formula uses ; instead of , and returns NA if no exact match is found. @JosWoolley has explained why calculation might take some time, thank you.
Oct 08 2023 04:59 AM
"so we can't use VBA or macros or arrays or what have you"
I am not convinced that statement is correct; my understanding is that Dynamic arrays, Lambda, Typescript, Python were all introduced as part of the push to achieve platform independence.
As a 365 beta user I haven't used anything but array formulas for several years now.
I would suggest using a 3D array to hold the relevant portion of column A across sheets and then something of the sort
= LET(
nameheader, TOROW(sheetName),
located, HSTACK(data)=target,
rowIndex, SEQUENCE(ROWS(located)),
rowNumber, BYCOL(IF(located, rowIndex, ""), LAMBDA(c, TEXTJOIN(";", , c))),
FILTER(nameheader & ": " & rowNumber & " - " & target, LEN(rowNumber))
)
Oct 08 2023 09:22 AM
Oct 08 2023 09:23 AM
Oct 08 2023 09:44 AM
Oct 08 2023 10:58 AM
=$F5&": "&TEXTJOIN(";",,IF(SUM(LEN(BYROW(
INDIRECT("'"&$F5&"'!A1:A10000"),
LAMBDA(v,IF(v=$G$5,"A"&CELL("row",v),"")))))=0,"NA",
BYROW(INDIRECT("'"&$F5&"'!A1:A10000"),
LAMBDA(v,IF(v=$G$5,"A"&CELL("row",v),"")))))
&IF(SUM(LEN(BYROW(INDIRECT("'"&$F5&"'!A1:A10000"),
LAMBDA(v,IF(v=$G$5,"A"&CELL("row",v),"")))))=0,""," - "&$G$5)
You are welcome. This formula returns the intended output in my sheet.
Oct 08 2023 11:08 AM
Oct 08 2023 11:43 AM
Does it work if you drag the formula down? Otherwise can you attach a file without sensitive data which shows the error messages?
Oct 08 2023 12:08 PM
Oct 08 2023 01:39 PM
No, I stick to Windows desktop, so I just hoped that your application might be one of:
which support Dynamic arrays.
Oct 08 2023 03:47 PM
Oct 08 2023 04:50 PM