title: Export content of cell based on pattern
body: <p>Here is part of an excel spreadsheet I have that is repeated several times:</p>
  
  <p><img src="https://i.stack.imgur.com/LHq8U.png" alt="enter image description here"></p>
  
  <p>What I want to do is find a way to copy just the "CELL TO COPY" cells to a new column. The cells that have "A" and "B" never change but the contents in "CELL TO COPY" are always different. What I thought I would do is create a new formula in column B that is <code>=IF(AND(A1="A",A2="B"),A4,"")</code> where if the first cell is "A" and the next cell is "B", it would copy the 4th cell. This formula sort of works except I do not want to have the whitespace between the cells (see output below):</p>
  
  <p><img src="https://i.stack.imgur.com/FlMAe.png" alt="enter image description here"></p>
  
  <p>Would it be possible to have a formula that does this but does not add the whitespace between, like so?</p>
  
  <p><img src="https://i.stack.imgur.com/vXtdO.png" alt="enter image description here"></p>