title: Excel read entire column- extract results in other column
body: <p>I need an excel formula that help me to do the following. I want to read a "letter" in one column (B), and "extract" the values in the column next to it (A). Example Below: In the "Result" column of the example below my formula reads all the "g"s of column B and then write all the corresponding values. I have not been able to use VLOOKUP because always gives me the first value of the first "g" that finds. Is there a way to use VLOOKUP here. My current solution is the following formula         </p>
  
  <pre><code>{=INDEX($A:$B,SMALL(IF($B:$B=J$5,ROW($B:$B)),ROW(1:1)),1)} 
  </code></pre>
  
  <p>(J$5, is just the cell in which I have the letter "g", item to look for in column B). Although this formula worked, there are two drawbacks: 1) Once it finds no more "g" the return is "#NUM!", which I do not like, I which I get just a empty cell if it does not find more and 2) this formula is kind of slow, not a big deal, but I never so this before on my computer. Your input is highly appreciated.</p>
  
  <hr>
  
  <pre><code>    Column A    Column B  Result (letter g(J$5))
      23             f        27
      27             g        87
      34             h        54
      56             h        88
      87             g        4
      35             f        
      8              f        
      54             g        
      468            h        
      88             g        
      90             f        
      4              g        
  </code></pre>