How to Remove Duplicates of a Given Row using Formula?

gordonhtfu

New Member
Joined
Jan 9, 2014
Messages
9
Here is a sample (simplified) scenario that I am trying to resolve.

Given...
 TomPeterSamSusan
Combo11213
Combo2AABA
Combo3!@#$
Combo4abbc

<COLGROUP><COL style="WIDTH: 54pt" span=5 width=72><TBODY>
</TBODY>

Trying to make it into this by removing all the duplicates:
Combo1123 
Combo2AB  
Combo3!@#$
Combo4abc 

<COLGROUP><COL style="WIDTH: 54pt" span=5 width=72><TBODY>
</TBODY>

Is there any method using formula? I am preferring formula (over macro or advanced filter) because it would dynamically update the result if the value in given table changes.
 

XOR LX

Well-known Member
Joined
Jul 2, 2012
Messages
4,517
Hi,

You won't be able to have the original table values replaced as desired without VBA, though if you are happy with having a different table which updates to give your desired results then, assuming the original table as you give it is in the range A1:E5 (with headers in row 1 and column A), create another table (with identical dimensions and headers), enter this formula in the topleftmost cell and then copy across and down to fill the table:

=IF(COLUMNS($A:A)>SUMPRODUCT(1/COUNTIF($B2:$E2,$B2:$E2)),"",OFFSET(B2,,SUMPRODUCT(--(FREQUENCY(MATCH($B2:B2,$B2:B2,0),MATCH($B2:B2,$B2:B2,0))>1)),,))

Regards
 

gordonhtfu

New Member
Joined
Jan 9, 2014
Messages
9
Hi,

You won't be able to have the original table values replaced as desired without VBA, though if you are happy with having a different table which updates to give your desired results then, assuming the original table as you give it is in the range A1:E5 (with headers in row 1 and column A), create another table (with identical dimensions and headers), enter this formula in the topleftmost cell and then copy across and down to fill the table:

=IF(COLUMNS($A:A)>SUMPRODUCT(1/COUNTIF($B2:$E2,$B2:$E2)),"",OFFSET(B2,,SUMPRODUCT(--(FREQUENCY(MATCH($B2:B2,$B2:B2,0),MATCH($B2:B2,$B2:B2,0))>1)),,))

Regards
Thank you. You are too smart.

How do you find the answer so quickly to random questions? :)
 

XOR LX

Well-known Member
Joined
Jul 2, 2012
Messages
4,517
Probably as I am fortunate enough to be able to see order within that apparent randomness! :)

Glad I could help and thanks for the feedback.

Regards
 

Forum statistics

Threads
1,082,243
Messages
5,363,972
Members
400,772
Latest member
solbebe

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top