Removing duplicates*%20Select%20the%20range%20you%20want%20to%20remove%20the%20duplicates%20from%2C%20Go%20into%20the%20Data%20Tab%2C%20under%20the%20data%20tools%20group%20click%26nbsp%3B%3CSTRONG%3ERemove%20Duplicates%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E*%20Check%20the%20two%20column%20you%20want%20to%20remove%20the%20Duplicat!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMMcDonal%3C%2FP's%20well%20with%20you.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20were%20most%20helpful%20to%20me%20in%20July.%26nbsp%3B%20Was%20hoping%20you%20could%20you%20help%20me%20out%20with%20the%20following%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20large%20spreadsheet%20with%20multiple%20duplicate%20values%20from%20the%20same%20client%20source.%20However%2C%20there%20are%20different%20policies%20assigned%20to%20the%20client%20source%20that%20I%20do%20not%20wish%20to%20remove%20when%20applying%20the%26nbsp%3B%20%22remove%20duplicates%22%20function.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20attached%20sample%20shows%20duplicate%20values%20for%20different%20policies%20for%20the%20same%20client%20name.%20The%20source%20of%20the%20duplicate%20values%20(losses)%20is%20the%20client%20name%20and%20one%20or%20several%20of%20the%20policy%20(numbers)%20for%20that%20client%20name.%20For%20my%20needs%2C%20it%20does%20not%20matter%20which%20of%20the%20policies%20make%20up%20the%20duplicate%20value.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20like%20to%20retain%20all%20policies%20relating%20to%20the%20same%20client%20source%20but%20reflect%20the%20duplicate%20value%20only%20once%2C%20as%20shown%20in%20the%20attached%20sample.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP's%20not%20removing%20of%20duplicates%20for%20which%20you%20remove%20entire%20rows%20based%20on%20some%20criteria.%20Here%20you'd%20like%20to%20empty%20repeating%20values%20in%20first%20and%20second%20columns%20keeping%20the%20rest%20untouched.%3C%2FP%3E%0A%3CP%3EBetter%20to%20do%20that%20with%20formulas%20in%20these%20first%20columns.%20Logic%20of%20formula%20depends%20on%20logic%20of%20the%20data%20structuring%20-%20will%20it%20be%20sorted%2Ffiltered%20or%20not%3B%20is%20it%20necessary%20to%20treat%20differently%20zero%20values%20and%20empty%20cells%3B%20shall%20we%20empty%20these%20values%20only%20for%20sequentially%20repeating%20values%20in%204th%20column%20or%20that%20doesn't%20matter.%20For%20example%2C%20in%20your%20sample%20you%20empty%20values%20for%26nbsp%3BGGG%20Demolition%2C%20Inc.%20but%20not%20for%26nbsp%3BBairos%20Recycling%20Inc%2C%20which%20also%20is%20repeating%20with%20non-zero%20values%2C%20but%20not%20one%20by%20one.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20example%2C%20in%20A3%20it%20could%20be%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3DIF(%20(D3%3DD2)*(A2%26gt%3B0)%2C%22%22%2C%20SUMPRODUCT(('N%3A%5CAudit%20Database%5C2019%20Audits%5CLos%20Angeles%5CNovember%202019%5CEnvironmental%5CLosses%5C%5BEnvironmental%20Loss%20Run%2010.14.19.xlsx%5DSheet1'!%24A%3A%24B%3DD3)*1))%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%2C%20similar%20in%20B3%20and%20we%20may%20drag%20them%20down.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPerhaps%20above%20formulas%20shall%20be%20more%20complex%2C%20but%20again%2C%20it%20depends%20logic%20of%20data%20itself.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor


How do I remove duplicate values associated with a name only?  I have a number of the duplicate values that are repeated across a table range and correspond to different names (in the column to the right of the values.)


I only want to delete duplicate values associated with each corresponding name only, and not all duplicate values in the table range.  Thanks.


11 Replies

Hey @MMcDonal 


Try This:


* Select the range you want to remove the duplicates from, Go into the Data Tab, under the data tools group click Remove Duplicates:

* Check the two column you want to remove the Duplicates from and click OK







Thanks EWC.  I believe your method would remove all duplicate values irrespective of the duplicate values based on different sources.


See screenshot below of a larger spreadsheet where there are duplicate values.  My goal is to remove only duplicate values by source only.  So in this case, removal of all duplicate values by source (name), including the $3,000 duplicate value for GenD, but not for Henry S. and HewP since they are separate sources/names. 


The $3,000 values for GenD and HenryS should remain intact/not removed, since they are separate sources of the duplicate values within the range (spreadsheet).


Removal of Duplicate Values per Each Source.png






To remove by source select all columns in your range and check only one with source


Result is


@Sergei Baklan 


Thank you Sergei, particularly since it is a function I will need to use repeatedly on numerous similar projects going forward.  

@MMcDonal , Power Query could be a variant

@Sergei Baklan


Hi Sergei.  Coming back to you after 4 months. Hope all's well with you. 


You were most helpful to me in July.  Was hoping you could you help me out with the following?


I have a large spreadsheet with multiple duplicate values from the same client source. However, there are different policies assigned to the client source that I do not wish to remove when applying the  "remove duplicates" function.


The attached sample shows duplicate values for different policies for the same client name. The source of the duplicate values (losses) is the client name and one or several of the policy (numbers) for that client name. For my needs, it does not matter which of the policies make up the duplicate value. 


I would like to retain all policies relating to the same client source but reflect the duplicate value only once, as shown in the attached sample. 






In your latest sample it's not removing of duplicates for which you remove entire rows based on some criteria. Here you'd like to empty repeating values in first and second columns keeping the rest untouched.

Better to do that with formulas in these first columns. Logic of formula depends on logic of the data structuring - will it be sorted/filtered or not; is it necessary to treat differently zero values and empty cells; shall we empty these values only for sequentially repeating values in 4th column or that doesn't matter. For example, in your sample you empty values for GGG Demolition, Inc. but not for Bairos Recycling Inc, which also is repeating with non-zero values, but not one by one.


For example, in A3 it could be

=IF( (D3=D2)*(A2>0),"", SUMPRODUCT(('N:\Audit Database\2019 Audits\Los Angeles\November 2019\Environmental\Losses\[Environmental Loss Run 10.14.19.xlsx]Sheet1'!$A:$B=D3)*1))

, similar in B3 and we may drag them down.


Perhaps above formulas shall be more complex, but again, it depends logic of data itself.

Thanks Sergei. I will take a look at your formula and see if it works for my purpose.
You raised some good questions: (a) The data does not have to be filtered/sorted; (b) there is no difference between cells with zero values and empty cells. (I removed the repeated (non-zero) values for GGG Demolition under to "To This" data set and left those cells blank/empty, and (c) I overlooked the second/lower $810 entry for Bairos Recycling, which I should have cleared/deleted under the "To This" data group, same as I did with GGG Demolition.
Again, thanks.


Thank you for the clarification. With this I'd use the formula as

=IF( COUNTIF($D$2:$D2,$D3),0, SUMPRODUCT(('N:\Audit Database\2019 Audits\Los Angeles\November 2019\Environmental\Losses\[Environmental Loss Run 10.14.19.xlsx]Sheet1'!$A:$B=D3)*1))

and apply to column custom number format as


to hide zeros. 

@Sergei Baklan 


This is [very] good.   Thanks Sergei for your time, effort, and expertise.




Michael, you are welcome

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
22 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
13 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
description for autoplay blocking in settings page
HotCakeX in Discussions on
8 Replies