A B
X1 16
X2 17
X2 18
X2 19
X3 21
I have two columns as above.
If there are duplicates in Column A
(here the duplicate value is "X2"), then I need to insert in another sheet:
- value "18" – i.e. second value of duplicates
- value "19" – i.e. subsequent value(s)
How can I find duplicates in column A
, and then for all duplicates except the first one from each group, get the values from a different column?
I have tried with many IF, FIND formulas, but nothing seems to work.
Any suggestions?
Best Answer
Let's say your values are in cells
A2:B6
. You can accomplish this by performing the following steps:Paste the following formula into cell
C2
(and also provide a column header, if desired). This formula will returnTRUE
for all duplicates that are not the first instance, and it will returnFALSE
otherwise:=COUNTIF($A$2:$A2, A2)>1
Formula-copy cell
C2
down through cellC6
Select cells
A1:C6
, click the "Data" ribbon, then click the "Filter" iconClick the filter dropdown that now exists in cell
C1
, and de-select theFALSE
checkboxSelect the values in column
B
that are still visible, and copy/paste to the new sheet