Forum Discussion
Rachwar30
Aug 23, 2022Copper Contributor
Find and replace
Hi there. In excel I would like to find values from one column anywhere within another column and replace with corresponding values from a third column and return it in a fourth column. Examp...
mtarler
Aug 24, 2022Silver Contributor
I think I'm reading it differently. I think you want to replace the value in Col D with the value from Col C if Col A has a match in Col B. So for row 3 the number 534 is in Col B so use that row's value in Col C (53) in Col D. That said what do you use if there isn't a match? A formula can't 'replace' a value it can only calculate and display a value. So if the values in Col D are calculated then we can add a conditional to that formula, otherwise you will need to use Col E to display col D OR col C from the other row. Something like this in E2:
=IFERROR(VLOOKUP(A2,B2:C100,2,0),D2)
So basically if the value in col A in this row can be found in Col B then return Col C, but if it isn't found then return the value in D2.
=IFERROR(VLOOKUP(A2,B2:C100,2,0),D2)
So basically if the value in col A in this row can be found in Col B then return Col C, but if it isn't found then return the value in D2.