Excel Index Match - Partial strings with Multiple Results

后端 未结 2 1603
有刺的猬
有刺的猬 2021-01-15 06:13

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

2条回答
  •  清酒与你
    2021-01-15 06:19

    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:

    1. Returning the cell that matches my search criteria in my index
    2. Making the cell draggable in two dimensions so I could index multiple columns for specific information
    3. Making the "nth" counter vertical instead of horizontal (as my application is a database of sorts, and each column is a separate entry. At the top of each column is 5 rows populated based on the search term [in my case, the store number])

    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!!

提交回复
热议问题