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

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
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,093
Messages
6,123,066
Members
449,090
Latest member
fragment

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