title: Find match in second column using possible non-unique value in first column
body: <p>I have two columns of data: <code>SubID</code> (<code>Column A</code>) and <code>Gender</code> (<code>Column B</code>).  The <code>SubID</code> can be listed several times in <code>Column A</code>.  I would like to create a new column (<code>Column C</code>) that lists the <code>Gender</code> with every instance that the <code>SubID</code> occurs in <code>Column A</code>.  </p>
  
  <p>To do this I need to lookup/match the <code>Gender</code> in <code>Column B</code> with the <code>SubID</code> in <code>Column A</code>, while only reporting the <code>Gender</code> in <code>Column C</code> and without returning a blank cell or just a repeat of <code>Column B</code>.</p>
  
  <p>I have used <code>VLOOKUP</code> and <code>INDEX/MATCH</code> without any real luck.  I'm sure something in my formula is set up incorrectly.</p>
  
  <p>Below is an example of my data and some of the formulas I have tried. </p>
  
  <p><a href="https://i.stack.imgur.com/FpDyf.pngter" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FpDyf.pngter" alt="sample"></a></p>
  
  <p><code>=IF(B2=".",INDEX($A$2:$B$6081,MATCH(A2,$A$2:$A$6081,0),2),INDEX($A$2:$B$6081,MATCH(A2,$A$2:$A$6081,0),2))</code></p>
  
  <p><code>=IF(B3=".",(IF($A$2:$A$6081=$B$2:$B$6105,$B$2:$B$6081,"x")))</code></p>
  
  <p><code>=IF(ISERROR(INDEX($A$2:$B$6081,SMALL(IF($A$2:$A$6081=A4,ROW($A$2:$A$6081)),1),2)),"",INDEX($A$2:$B$6081,SMALL(IF($B$2:$B$6081=A4,ROW($A$2:$A$6081)),1),2))</code></p>