# Conditional remove duplicate in excel

I have a dataset where I want to remove duplicates in column H for each corresponding unique value in column I. For example, in the screenshot in the link, if I just remove duplicate in column H there would only be 1 row left. However, I need to preserve both unique values in column I. Note that I cannot just remove duplicates in column I because I am not looking for unique values in column I by itself, but rather all applicable column I values in relation to each distinct column H value. How can I do this?

Example screenshot

• You mean to say after you remove duplicates in Column H `10728051` & in Column I `15.39785 nd 24.85653` should remain !! ☺ – Rajesh S Sep 9 '18 at 5:56
• Welcome to SuperUser. From your public data I see that you have not yet visited the tour. Please do so, and read it to the end, it only takes a minute. Also familiarize yourself with the help center, especially regarding asking. – Tom Brunberg Sep 9 '18 at 11:06
• Is my understanding correct, that if moving from top downwards, and inspecting one row (current row) at a time, you want to delete the current row, if both H and I columns hold values that already exist in a previous row? – Tom Brunberg Sep 9 '18 at 11:17
• Rajesh S - Yes, that is what I mean. Thanks for clarifying. – sheldonxp Sep 9 '18 at 23:49
• Tom Brunberg - actually I only want to delete the current row if H column hold values that already exist in the previous row, EXCEPT if there are multiply I column values that correspond to the same H column value. In these exceptional cases, I want all the unique I column values that correspond to that same H column value to remain. Hope that clears things up? – sheldonxp Sep 9 '18 at 23:51

From what I've understood,

• Columns G, H & I are interdependent on each other to set a row as unique in your data set.
• Therefore our criteria for a unique row of data is;
• each row in your data set only requires 1 unique value in either Column G and/or Column H and/or Column I to set itself as unique to all other rows.

How to remove duplicates that do not meet the above criteria

2. In DATA Tab click on Remove Duplicates
3. Click on 'Unselect All'
4. Check 'My data has headers'
6. Click Ok

• Sorry, I had a typo in my original question which may have confused things. I have edited the question to clear up - I am only concerned about columns H and I, not G. Also, my comment in response to Tom Brunberg's comment may help clarify things as well. Thanks! – sheldonxp Sep 9 '18 at 23:52
• Just select headers H & I then, from the 9 rows of data you posted in the snippet only 2 rows are unique based on column H & I, your question needs some more work. – angelofdev Sep 10 '18 at 0:11