title: Paste leading common substrings from another sheet
body: <p>In Excel, Sheet1 I have the following column in one sheet that contains names:</p>
  
  <p><a href="https://i.stack.imgur.com/bqBYK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bqBYK.png" alt="enter image description here"></a></p>
  
  <p>In Sheet2 I have a column called substring as shown in the screenshot below (for simplicity I just use 1 row):</p>
  
  <p><a href="https://i.stack.imgur.com/5vZ2V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5vZ2V.png" alt="enter image description here"></a></p>
  
  <p>For each name in Sheet1, I want to check if it contains any of the substrings in Sheet2, which is "abreu" in this case. If the name contains the substring from Sheet2 AND the substring is in the beginning of the name, then paste the substring to the cell next to it. If the name doesn't contain the substring, then don't do anything. The desired output should look like the screenshot below:</p>
  
  <p><a href="https://i.stack.imgur.com/91ZcT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/91ZcT.png" alt="enter image description here"></a> </p>
  
  <p>I have tried VLOOKUP which doesn't quite work because it's either full match or partial match and none of which fit my case here. I also tried the SEARCH function which also doesn't detect whether the substring is in the beginning of the name. Any help is greatly appreciated.</p>