View Single Post
 
Old 12-16-2020, 12:48 PM
Purfleet Purfleet is offline Windows 10 Office 2019
Expert
 
Join Date: Jun 2020
Location: Essex
Posts: 345
Purfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to beholdPurfleet is a splendid one to behold
Default

To be fair is mainly just repeating bits.

to stop partial matches use =MID(A2,AGGREGATE(15,6,SEARCH(Words&" ",A2),1),SEARCH(" ",A2,AGGREGATE(15,6,SEARCH(Words&" ",A2),1))-AGGREGATE(15,6,SEARCH(Words&" ",A2),1)).

The search part (SEARCH(Words&" ",A2),1) finds the word, the space finds the whole whole and not partials

aggregate 15 is the same as small but aggregate can deal with arrays, the 6 is telling it to ignore errors (i.e not matches). So if there are 2 matches this will find only the first one

the first AGGREGATE finds the number of the first character of the word we are looking for. (26)

the second AGGREGATE finds the number of the first space after the word we are looking for (31)

the third is just a repeat of the first AGGREGATE.

All this in the MID makes it Mid(a2,26,31-26)

Hope it helps
Reply With Quote