I\'m trying to tweak this piece of code I found in a sample spreadsheet online but I can\'t quite get my head around it.
The original spreadsheet basically does an I
Building on Barry's code a little, I needed to make a few tweaks for my own use (current project I have at work).
Tweaks I made:
The final result is:
=IFERROR(INDEX(A$8:A$295,SMALL(IF(ISNUMBER(SEARCH('Store History'!$F$2,A$8:A$295)),ROW(A$8:A$295)-ROW(A$8)+1),ROWS(A$2:A2))),"")
It is worth repeating that this is an array formula and needs to be entered using CTRL+SHIFT+ENTER
This is placed in cell A2 and is dragged both vertically and horizontally (horizontally in my case is ever expanding as I add more entries into my database).
My purpose for adding this comment (even though it is a long inactive thread) is to try and make this a more relevant search result on Google for "excel index match partial strings with multiple results" or variations of that. It took me hours of searching to find this solution, and it is extremely functional and elegant. My thanks to the OP and especially to Barry for his code!!
Assuming by "partial match" you mean text that starts with the value in L1
then use this 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 with CTRL+SHIFT+ENTER and copy across
For a match anywhere in the text you can use this 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 is case-sensitive, although you can easily make the latter so by changing SEARCH
to FIND
Use of IFERROR
function means you don't need repetition for error handling - needs Excel 2007
or later version