title: Excel to replace cell value based on lookup in another sheet
body: <p>Cannot figure this out, I searched for hours and tested using vlookup.</p>
  
  <p>I want to change or replace the value of cells in column A in sheet1 if value in column P is found in column A located in sheet2.</p>
  
  <p>I get it close to what I want but I get blank cells when no match is found. I need the cells in column A to keep their original value if no match has been found.</p>
  
  <p>Formula I used:</p>
  
  <pre><code>=IFERROR(VLOOKUP(P2,sheet2!$A$2:$B$13,2,FALSE),"")
  </code></pre>
  
  <p>Sheet1:</p>
  
  <pre><code>         A              P
   1 [References]---[ID numbers]
   2 [  000001  ]---[   123    ]
   3 [  000002  ]---[   456    ]
   4 [  newref  ]---[   999    ]
   5 [  000003  ]---[   789    ]
  </code></pre>
  
  <p>Sheet2:</p>
  
  <pre><code>         A              B
   1 [ID Numbers]---[References]
   2 [   123    ]---[xxx-000001]
   3 [   789    ]---[xxx-000003]
   4 [   456    ]---[xxx-000002]
  </code></pre>
  
  <p>Result sheet 1 should be:</p>
  
  <pre><code>         A              P
   1 [References]---[ID numbers]
   2 [xxx-000001]---[   123    ]
   3 [xxx-000002]---[   456    ]
   4 [  newref  ]---[   999    ]
   5 [xxx-000003]---[   789    ]
  </code></pre>
  
  <p>If this is not possible to achieve maybe using a prefix could work? Like adding (xxx-) when a match is found?</p>
  
  <p>I appreciate your pointers, thanks for your advice.</p>