need formula, for counting and deleting duplicate entries

sidd0053

New Member
Joined
Jun 8, 2018
Messages
9
I want excel to automatically count a duplicate, show the value (number of duplicates) in another cell and then delete the duplicate while still maintaining that value.

Basically the algorithm would be:
1.Excel sees there's a duplicate.
2.Plus 1 to the column B of the first occurrence.
3.Delete the duplicate while still maintaining the value of the B column in the first occurrence.
4.Repeat the process if there is more duplicate entry.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
suppose you have data in column A starting from A2, enter the formula '=IFERROR(MATCH(A2,$A$1:A1,0),0)' in B2 and drag down. filter all the non-zeros in column B, and right click and then select 'Delete row' option.
 
Upvote 0
suppose you have data in column A starting from A2, enter the formula '=IFERROR(MATCH(A2,$A$1:A1,0),0)' in B2 and drag down. filter all the non-zeros in column B, and right click and then select 'Delete row' option.

It didn't really work out,

[TABLE="width: 789"]
<colgroup><col span="2"><col></colgroup><tbody>[TR]
[TD]Job Standard Training[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]Job Standard Training[/TD]
[TD="align: right"]2294[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]Town hall[/TD]
[TD="align: right"]1550[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]Town hall[/TD]
[TD="align: right"]1550[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]Appeals Branch[/TD]
[TD="align: right"]2292[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]Appeals Conference[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]WR Staff Meeting[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]Nancy[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]RAD Training[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]TD1055 Design and Content Building[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]TD1055 Design and Content Building[/TD]
[TD="align: right"]2303[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]TD1055 Design and Content Building[/TD]
[TD="align: right"]2303[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]TD1055 Design and Content Building[/TD]
[TD="align: right"]2303[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]Presentation[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]T3[/TD]
[TD="align: right"]1949[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]ADA Forum / Nicole Blanchard[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]2[/TD]
[/TR]
</tbody>[/TABLE]

Column B is the formula that you gave, Column C is how many duplicates there are with the formula that I used. Except with my formula if I delete the duplicate entries in column 'A' than the # shown in 'C' changes accordingly. TD1055 DESIGN is showing 2303, its not possible that there are that many entries for it.
 
Upvote 0
Say your data are in A2:A100

Steps
Formula in B2 copied down until B100
=COUNTIF(A:A,A2)-1

Select B2:B1100
copy and paste only values

Select A2:B100
Data > Remove duplicates

M.
 
Upvote 0
Say your data are in A2:A100

Steps
Formula in B2 copied down until B100
=COUNTIF(A:A,A2)-1

Select B2:B1100
copy and paste only values

Select A2:B100
Data > Remove duplicates

M.

This works for me, thank you.

Just wondering as to why the "-1" in the formula?
 
Upvote 0
You are welcome. Thanks for the feedback.

About -1
It is not necessary - thought you wanted to count only when there was a duplicate

M.
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

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