1

I would like to search an array for a cell in the function's row and return the cell adjacent to the matching array row. The array cells contain partial matches with the function's row.

clients return
bob smith ***!!!
kim lee
joe blow
frank tank
array value
joe 15
bob 21
frank 33
kim 7

Sample data table

=(INDEX($A$8:$A$11,MATCH(1,ISNUMBER(SEARCH($A$8:$A$11,A2))*1,0)))

This functions returns the matching array cell but not the value adjacent to the marching array cell. I want the numbers; not the names.

3
  • Index the second column? =(INDEX($B$8:$B$11,MATCH(1,ISNUMBER(SEARCH($A$8:$A$11,A2))*1,0))) Commented Oct 6 at 19:03
  • 3
    Be careful for false positives this way. If you search kim it would match on kimberly for instance, or even Rakim. Commented Oct 6 at 19:25
  • 2
    Try =IFNA(INDEX($B$8:$B$11,MATCH(1,--ISNUMBER(SEARCH("|"&$A$8:$A$11&"|","|"&SUBSTITUTE($A2," ","|")&"|")),0)),""). Commented Oct 6 at 19:40

2 Answers 2

2

You may try the following formula-

=FILTER($G$2:$G$5,NOT(ISERROR(XMATCH($F$2:$F$5,TEXTSPLIT(A2,," ")))))

If you want only first name match, then could try-

=XLOOKUP(TEXTSPLIT(A2:A5," "),F2:F5,G2:G5)

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

0

This formula looks for the first word (separated by space) of the client name and return the number corresponding in the second table.

=SUM(IF(LEFT(A2,SEARCH(" ",A2)-1)=A$8:A$11,B$8:B$11,""))

The formula is placed in cell B2 and drag down

A B
clients return
bob smith 21 'formula is here
kim lee 7
joe blow 15
frank tank 33
array value
joe 15
bob 21
frank 33
kim 7

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.