Remove duplicates in rows, not columns

FlashDota

New Member
Joined
Jun 11, 2023
Messages
28
Office Version
  1. 2021
Platform
  1. Windows
Hello,
I am trying to remove duplicates going through rows, but the only option I can find on Excel is removing them from each column. Is there a way to achieve this either with a formula or using VBA?

i.e from the picture:
Row 1 - delete nothing
Row 2 - delete the "B" and bring two "A"s near each other
Row 3 - delete the "A"

Capture.PNG
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
In cel E1 and copy down:

Excel Formula:
=LET(a,A1:C1,IF(COUNTA(UNIQUE(a,TRUE))<COUNTA(a),FILTER(a,COUNTIF(a,a)>1),a))
 
Upvote 0
Hello,
I am trying to remove duplicates going through rows, but the only option I can find on Excel is removing them from each column. Is there a way to achieve this either with a formula or using VBA?

i.e from the picture:
Row 1 - delete nothing
Row 2 - delete the "B" and bring two "A"s near each other
Row 3 - delete the "A"

View attachment 93597
Your question does not make much sense to me.
Are you trying to remove the duplicates, or leave the duplicates?
Also, there is now "B" in Row 2. Perhaps you are mixing up your words, and really mean "Column" where you have written "Row"?

It would helpful if you showed us what your expected output of your example should be.
 
Upvote 0

Forum statistics

Threads
1,215,089
Messages
6,123,058
Members
449,091
Latest member
ikke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top