How to remove the duplicate row based on the name in google sheet?

Viewed 48

enter image description here

HI everyone,

I want to remove the duplicate row based on the name column even though the Category is different, so the Category that I want to remove is Category 2 and the second, third,... row of category 1.

For example in the screenshot above, row 12, row 13 and row 14 are having the same name, so the row that should be removed is row 12 as it is Category 2 and also row 14 as it is he second row of category 1.

Is there any trick that I can use to achieve this? Any help will be greatly appreciated!

Edit

enter image description here

2 Answers

try:

=SORTN(SORT(A5:C), 9^9, 2, 2, 1)

update:

=ARRAY_CONSTRAIN(SORTN(SORT({A5:C, ROW(A5:A)}, 1, 1, 4, 1), 9^9, 2, 2, 1), 9^9, 3)

enter image description here

I'm not sure if you really need to sort on the row number, just don't sort on the last column:

=sortn(sort(A5:C,1,true),9^9,2,2,true)

enter image description here

Related