Excel 2007: Delete Duplicate Records, Keep Duplicates Meeting Criteria

CGXLuser

New Member
Joined
Mar 17, 2014
Messages
2
Hi,

I use excel a lot at work and want to start making my job easier. I am trying to learn how to use VBA, but need an answer on this issue sooner than later. I am trying to get data from a report, but I need to delete duplicate records to get accurate information. However, there are some instances where I do need some duplicates if it meets one criteria. My spreadsheet has too much info for me to post it all, so here is an attempt to simplify what it looks like:

Column A (Scheduler) Column B(Course) Column C(Session) Column D(Attendance) Column E(Students)
1 OP1 100 1 Enrolled 3
2 OP1 100 1 Waived 2
3 OP1 100 1 Request 5
4 OP1 101 1 Enrolled 13
5 OP1 101 1 Request 2
6 OP2 200 2 Enrolled 8
7 OP2 200 2 Cancelled 2
8 OP2 200 2 Request 3

So here's what I am looking for:
- I want to delete duplicates and keep one record based on attendance precedence: (1) Enrolled, (2) Waived,(3) Request, (4) Cancelled
- The duplicates should be based on course and session.
- 1,2,3 are duplicates, 4,5 are duplicates, and 6,7,8 are duplicates
- In addition to records with the value "Enrolled," I want to keep any record that also has the value "Waived"

So, my goal is to run a macro (Unless there is a simple task that can do this for me in excel) to make result in the following:

Column A (Scheduler) Column B(Course) Column C(Session) Column D(Attendance) Column E(Students)
1 OP1 100 1 Enrolled 3
2 OP1 100 1 Waived 2
3 OP1 101 1 Enrolled 13
4 OP2 200 2 Enrolled 8

I hope this isn't confusing. Appreciate any assistance!

CGXLuser
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Sorry for the formatting, this is what I meant to have:

What I see:
Record
Column A (Scheduler)
Column B(Course)
Column C(Session)
Column D(Attendance)
Column E(Students)
1
OP1
100
1
Enrolled
3
2
OP1
100
1
Waived
2
3
OP1
100
1
Request
5
4
OP1
101
1
Enrolled
13
5
OP1
101
1
Request
2
6
OP2
200
2
Enrolled
8
7
OP2
200
2
Request
3
8
OP2
200
2
Cancelled
2

<tbody>
</tbody>

What I want:
Record
Column A (Scheduler)
Column B(Course)
Column C(Session)
Column D(Attendance)
Column E(Students)
1
OP1
100
1
Enrolled
3
2
OP1
100
1
Waived
2
3
OP1
101
1
Enrolled
13
4
OP2
200
2
Enrolled
8

<tbody>
</tbody>


CGXLuser
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,816
Members
449,049
Latest member
cybersurfer5000

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