Removing Duplicates with formula

Helix242

Board Regular
Joined
Jun 28, 2016
Messages
78
Evening everyone,

Please can yyou help with an issue. I am trying to remove any duplicates from a sheet using a formula so this does not have to be done manually. However the 2 formulas I have used, do not work when there is more than one entry. Can anyone help?

Code:
=IF(W4="","",IF(COUNTIF(W4:W9999,W4)>1,"",W4))
Code:
=IF(W4="","",IF(COUNTIF(W4:W9999,W4)=1,"",W4))

These are the 2 I have used, but I am at a loss! :)

Many thanks in advance
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Actually the below should work for both (adjust the ranges to suit)...


Excel 2016 (Windows) 64 bit
AB
1Name
2AnnAnn
3AnnBetty
4BettyCarol
5Carol 
6Carol
9Ann
10Ann
11Betty
Sheet1
Cell Formulas
RangeFormula
B2=IFERROR(INDEX($A$2:$A$11, MATCH(0, INDEX(COUNTIF($B$1:B1, $A$2:$A$11), 0, 0), 0)), "")
B3=IFERROR(INDEX($A$2:$A$11, MATCH(0, INDEX(COUNTIF($B$1:B2, $A$2:$A$11), 0, 0), 0)), "")
B4=IFERROR(INDEX($A$2:$A$11, MATCH(0, INDEX(COUNTIF($B$1:B3, $A$2:$A$11), 0, 0), 0)), "")
B5=IFERROR(INDEX($A$2:$A$11, MATCH(0, INDEX(COUNTIF($B$1:B4, $A$2:$A$11), 0, 0), 0)), "")
 
Last edited:
Upvote 0
Actually the below should work for both (adjust the ranges to suit)...

Excel 2016 (Windows) 64 bit
AB
1Name
2AnnAnn
3AnnBetty
4BettyCarol
5Carol
6Carol
9Ann
10Ann
11Betty

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
B2=IFERROR([COLOR=rgb(255]INDEX($A$2:$A$11, MATCH([COLOR=0)]0, INDEX([COLOR=rgb(0]COUNTIF($B$1:B1, $A$2:$A$11), 0, 0[/COLOR]), 0[/COLOR])), ""[/COLOR])
B3=IFERROR([COLOR=rgb(255]INDEX($A$2:$A$11, MATCH([COLOR=0)]0, INDEX([COLOR=rgb(0]COUNTIF($B$1:B2, $A$2:$A$11), 0, 0[/COLOR]), 0[/COLOR])), ""[/COLOR])
B4=IFERROR([COLOR=rgb(255]INDEX($A$2:$A$11, MATCH([COLOR=0)]0, INDEX([COLOR=rgb(0]COUNTIF($B$1:B3, $A$2:$A$11), 0, 0[/COLOR]), 0[/COLOR])), ""[/COLOR])
B5=IFERROR([COLOR=rgb(255]INDEX($A$2:$A$11, MATCH([COLOR=0)]0, INDEX([COLOR=rgb(0]COUNTIF($B$1:B4, $A$2:$A$11), 0, 0[/COLOR]), 0[/COLOR])), ""[/COLOR])

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

thank you very much for this. Something I should have asked initially is, is it possible to leave a blank where the duplicate one is?

many thanks!
 
Upvote 0

Forum statistics

Threads
1,213,520
Messages
6,114,101
Members
448,548
Latest member
harryls

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