Oct 14 2023 10:44 AM
Hi all,
I have a formula that searches another worksheet and only returns the first exact match. How can it be edited to return ALL exact matches? This is the formula:
=IFERROR($F5&": "&TEXTJOIN("; ", TRUE, IF(XMATCH($G$5, INDIRECT("'"&$F5&"'!A1:A2000"), 0), "A"&XMATCH($G$5, INDIRECT("'"&$F5&"'!A1:A2000"), 0)&" ("&$G$5&")"&"; ", "")), $F5&": N/A")
$F5 is the worksheet/name we are searching in (only cells A1:A2000).
$G$5 is the exact search phrase we are searching for.
Any suggestions?
Thanks in advance!
Oct 14 2023 10:50 AM
Has this already been asked?
Formula for returning multiple exact matches - Microsoft Community Hub
Oct 14 2023 11:41 AM
Oct 14 2023 11:47 AM
Oct 14 2023 12:21 PM
I don't know why it doesn't work on your computer and i can't suggest a solution since i can't see what is on your screen. The suggested formula returns the expected results in my Excel for the web as you can see in the screenshot of the other discussion.
I found your question very interesting and i ended up with a formula which spills the results for several search values. The search values are in range G5:G8 in this example.
In an intermediate step i pulled the data from all sheets (Tabelle17:Tabelle21 in this example) in the result sheet. This data is in range F11:J21 in the screenshot.
Oct 14 2023 12:25 PM
Oct 14 2023 11:22 PM
Oct 15 2023 06:33 AM
As variant
=LET(
col, "A1:A2000",
range, INDIRECT("'" & $F$5 & "'!" & col ),
f, TOCOL( (range=$G$5)*ROW(range),3),
output,
$F$5 &
": " &
TEXTJOIN("; ",, LEFT(col) & FILTER(f,f) ) &
" (" & $G$5 & ")",
IFERROR(output, "no match")
)
It shall be adjusted if column name is more than one character, but idea is the same.