excel - If any text within a range matches text within a cell, output matching text -


i need see if text in range c1:d3 matches text in a1. if does, output text b1. if doesn't, output nothing in b1.

using data list below, i've used array formula when lookup range in 1 column c1:c3, can't work when spreading lookup across 2 columns c1:d3.

this worked when searching across 1 column: column c

{=iferror(index($c$1:$c$3,match(1,countif(a1,"*"&$c$1:$c$3&"*"),0)),"")} 

changed it search across 2 columns - didn't work: columns c & d

{=iferror(index($c$1:$d$3,match(1,countif(a1,"*"&$c$1:$d$3&"*"),0)),"")} 

data

  • c1,2,3 contains: new york, los angeles, san diego
  • d1,2,3 contains: toronto, jacksonville, nyc
  • a1,2,3,4,5,6 contains: birth certificates new york, los angeles death certificates, marriage certificates, san diego divorce certificates, marriage certificates, divorce jacksonville
  • b1 contains formula, drag down through b6

any ideas how this?

this can accomplished nesting iferror functions pass lookup second column if first not produce match suspect sample data not adequately describe scope of c1:d3. sample data accomplished following array formula in b1.

 =iferror(index($c$1:$c$3,match(1,countif(a1,"*"&$c$1:$c$3&"*"),0)),iferror(index($d$1:$d$3,match(1,countif(a1,"*"&$d$1:$d$3&"*"),0)),"")) 

array formulas need finalized ctrl+shift+enter↵. once entered correctly can fill down necessary.

        two column lookup iferror

if scope of c1:d3 different you've described, other methods may more appropriate; including transposing lookup horizontal 1 if had more columns rows.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -