i'm trying tweak piece of code found in sample spreadsheet online can't quite head around it.
the original spreadsheet index/match based on user-defined lookup , lists matches neatly in concatenated list. sample spreadsheet's output looks this:
http://i.stack.imgur.com/dyahb.png - sample excel output (note how there no gaps between first , second matches)
the underlying algorithm is:
=if(iserror(index($a$1:$b$8,small(if($a$1:$a$8=$e$1,row($a$1:$a$8)),row(1:1)),2)),"",index($a$1:$b$8,small(if($a$1:$a$8=$e$1,row($a$1:$a$8)),row(1:1)),2))
now, want lookup instead retrieve partial matches, , in addition, generate outputs horizontally so:
http://i.stack.imgur.com/shed0.png - output generated horizontally based on partial matches
i'm not sure how go doing this. seems somehow try , change if condition return true on partial matches can't head around it. please help!
assuming "partial match" mean text starts value in l1 use formula in n1
=iferror(index($i$2:$i$8,small(if(left($h$2:$h$8,len($l$1))=$l$1,row($i$2:$i$8)-row($i$2)+1),columns($n1:n1))),"")
confirm ctrl+shift+enter , copy across
for match anywhere in text can use version
=iferror(index($i$2:$i$8,small(if(isnumber(search($l$1,$h$2:$h$8)),row($i$2:$i$8)-row($i$2)+1),columns($n1:n1))),"")
neither formula case-sensitive, although can make latter changing search find
use of iferror function means don't need repetition error handling - needs excel 2007 or later version
Comments
Post a Comment