Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove duplicate value but keep rest of the row values

I have a excel sheet(csv) like this one:

Excel data

and I want the output(tab delimited) to be like this:

excel data 2

Basically:

  • replace duplicates with blanks but
    • if col6 value is different from the previous row for the same col1 value, all the data fields should be included.

I am struggling to create a formula which would do this. If I try to "Remove Duplicates" it removes the value and shifts the values up one row. I want it to remove the duplicates but not shift the values up.

like image 837
stackErr Avatar asked Dec 11 '22 13:12

stackErr


1 Answers

Given that duplicate data cells are next to each other

and data are on column A with blank top row, this should work. It will remove duplicates except the first occurrence.

=IF(A1=A2,"",A2)
=IF(A2=A3,"",A3)
.
.
.
like image 70
ahem Avatar answered Dec 27 '22 20:12

ahem