How to match common string in a column

i have data like

 **column1                 column2**
Ram                        Praveen
Mohan                      Kumar
Praveen                   Chandra
Kumar
Dinesh
Hareesh
Chandra

but i want output like

**column1                 column2**
   Ram                       
    Mohan                      
    Praveen                Praveen
    Kumar                  Kumar
    Dinesh
    Hareesh
    Chandra             Chandra

Means which field are both sides matched.

Just write to C1

=IF(COUNTIF($B$1:$B$3;A1)>0;A1;"")

and drag the formula to the desired number of rows
Demo

Thanq it works fine… Is there any Libreoffice online tutorial pls let me know

Yes, of course