Forum Discussion
compare two columns
- May 17, 2020
Rising Flight See now that I made a mistake in the formula. Sorry! It should have been:
=IFERROR(VLOOKUP(B1,A:A,1,FALSE),"Not Found")But, since you are not interested to see the "Not Found", you could consider to filter these out. A manual process you probable don't want either.
This made me re-think and I could come up with the following (not most elegant) solution:
This formula works only if your Excel version supports the relatively new FILTER function.
=FILTER(VLOOKUP(B1:B5,A:A,1,FALSE),NOT(ISNA(VLOOKUP(B1:B5,A:A,1,FALSE))))It's demonstrated in the attached workbook.
Rising Flight This could be, e.g. in C1
=IFERROR(VLOOKUP(B1,A:A,2,FALSE),"Not Found")
and copy it dow column B.
- Rising FlightMay 17, 2020Brass Contributor
Thanks Riny
In the below screenshot i have ColumnA and ColumnB and in Column C i only want to get duplicate records, so the output i want to get in Column C is SrvC,SrvB,SrvA,SrvF since these 4 records in Column B are matching with Column A
- Riny_van_EekelenMay 17, 2020Platinum Contributor
Rising Flight See now that I made a mistake in the formula. Sorry! It should have been:
=IFERROR(VLOOKUP(B1,A:A,1,FALSE),"Not Found")But, since you are not interested to see the "Not Found", you could consider to filter these out. A manual process you probable don't want either.
This made me re-think and I could come up with the following (not most elegant) solution:
This formula works only if your Excel version supports the relatively new FILTER function.
=FILTER(VLOOKUP(B1:B5,A:A,1,FALSE),NOT(ISNA(VLOOKUP(B1:B5,A:A,1,FALSE))))It's demonstrated in the attached workbook.