Reputation: 13
I have a data set that looks something like this
Hostname: Abr: Descr:
123-svr-xyz svr Server
456-rtr-wxy rtr Router
I would like to do a string search of the Hostname field against the list of values in the Abr field, and return the corresponding Description from the Descr field.
I understand how index match formulas work, but I can't quite figure out how to reference a list in this way.
Any suggestions would be appreciated.
Upvotes: 0
Views: 46
Reputation: 152660
If the part that is being found is always the second part and deliniated with "-" then you can use this formula:
=INDEX(F:F,MATCH(MID(A2,FIND("-",A2)+1,FIND("-",SUBSTITUTE(A2,MID(A2,FIND("-",A2)+1,999),""))-1),E:E,0))
If not then you will need to use this array formula:
=INDEX($F$2:$F$3,MATCH(TRUE,ISNUMBER(SEARCH($E$2:$E$3,A2)),0))
Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode. If done correctly Excel will put {}
around the formula.
Upvotes: 1