Mark duplicates with a Y?

2013-10-22

New Member
Joined
Oct 22, 2013
Messages
16
I have a database table with lots of duplicate words in it and have exported the data to Excel.

Below is an extract - there are over 4,000 rows in total, where the duplicate count ranges from 8 down to 2.

The table is sorted by count_if and then word.

I'd like to find a way to mark all rows with a 'y' in the "del" column for all lines in each block of words (except the first line), so that I can filter by the y value in that column, copy the IDs and then enter in them into my database via SQL to delete the duplicates, e.g.

DELETE FROM my_table WHERE id IN (23633, 24551, 25629...);

Is that possible?

Any help would be much appreciated.

Thanks



idwordcatcount_ifdel
21790absolute18
23633absolute38y
24551absolute38y
25629absolute38y
26089absolute38y
27020absolute38y
27506absolute38y
28029absolute38y
22147shell338
24162shell38y
25246shell38y
26006shell38y
27444shell38y
27939shell38y
28347shell38y
28682shell38y
11038string227
22339string37y
22794string37y
24196string37y
24406string37y
24531string37y
25597string37y

<tbody>
</tbody>
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Say that your first row of actual data is on row 2, and your "word" column is column B, and your "del" column is column E.
Then enter this formula in cell E2 and copy down for all rows:
Code:
=IF(COUNTIF(B$2:B2,B2)>1,"y","")
That should return "y"s in that column exactly as you want.
 
Upvote 0
This sort of formula dragged down:

=IF(COUNTIF($B$2:B2,B2)>1,"Y","")
 
Upvote 0
I'm sorry, I don't understand what you want to happen here: "I'd like to find a way to mark all rows with a 'y' in the "del" column for all lines in each block of words (except the first line)"
There are already some y's on the page; are you needing a way to indicate rows where the ID is a duplicate of the ID of another row?
What "block of words" ?
Might really be easy but can't tell from what I read so far.

 
Upvote 0

Forum statistics

Threads
1,214,813
Messages
6,121,706
Members
449,049
Latest member
THMarana

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