Rii Pii
Rii Pii

Reputation: 101

Excel INDEX MATCH to find exact location name from string text

I have in my Excel workbook two tables:

  1. In first table I have string text full sentence (in colunmn C) in many rows where is described in sentence some place names (some rows don't have those location names) and
  2. in second table I have place names list (every place name have also geographical X (latitude) and Y (longitud) coordinates.

I want to search inside first table string text location names which have exact match to the placename_table list and show founded place name in first tabele column D. I tried this formula in column D, it almost working, but it finds first match of placename_tabele and it is not correct what was mean in first table string.

I use Excel 2013

=IFERROR(INDEX(Placename_table; SMALL(IF(COUNTIF($C2;"*"&Placename_table&"*"); MATCH(ROW(ANIMI); ROW(Placename_table)); ""); COLUMNS($A$1:A1))); "-")

placename_tabels

enter image description here

Upvotes: 0

Views: 116

Answers (1)

Harun24hr
Harun24hr

Reputation: 37125

You may try FILTERXML() with index. Put below formula in D2 cell then drag down and right.

=IFERROR(INDEX(FILTERXML("<t><s>"&SUBSTITUTE($C2," ","</s><s>")&"</s></t>","//s[starts-with(., 'placement')]"),COLUMN(A$1)),"")

enter image description here

Upvotes: 0

Related Questions