Radz
Radz

Reputation: 45

How to match a character in a string and lookup value from a table in excel

I want to check for a character in a string and if it matches I want to look up the value of that character from a table. e.g., I want to check a character F (A94) in the string HPCS (B63), if TRUE then the value 2 (B94) from the table (A34:B105) should be the outcome (at the position B65). If FALSE the value should be 0. Does anybody know how to do that in excel?

The excel file looks like this.

Upvotes: 2

Views: 623

Answers (1)

Harun24hr
Harun24hr

Reputation: 37125

You can give a try to below formula. But P.B raise a good point in comment. You need to clarify that.

=IF(ISNUMBER(SEARCH(A3,$B$1)),INDEX($F$4:$F$14,MATCH(A3,$E$4:$E$14,0)),0)

enter image description here

Upvotes: 2

Related Questions