Removing Duplicate Data Based On Conditions

Oct 10, 2011

Currently trying to solve a niggling issue with removing duplicate row data from competition entry databases using the following code...

Code:
Sub remove_duplicates()

Dim lastrow As Long
Dim i As Long, j As Long

On Error GoTo errhandler

Columns("A:G").Sort Key1:=Range("A2"), Order1:=xlAscending, Key2:=Range("B2") _

[Code] ......

errhandler:
'MsgBox Err.Description
End Sub

What I need to happen is for duplicates to be based on both the name and email matching (columns A + B) and then remove all duplicate rows, whilst ignoring but preserving the content in columns C,D,E and F on those rows that remain. Column G contains either "Yes" or "No" depending on a users membership status. Sometimes duplicated data will contain identical name and email address but have different membership status in column G where someone was logged in when submitting a form the first time, and then logged out the next (potentially a mixture of the two over multiple times). Therefore I need any duplicate users who have different values in the G column throughout the database to be detected by the macro and we must ensure that the single row retained in the final non-duplicated list displays "Yes" in column G for that user.

Duplicate users who are always "yes" or always "no" work fine, its only the ones with mixed values for column G that need to be analysed and their return forced as Yes in the final list.

The final list should preserve the original column structure and thus be only one row per unique user.

The above code appeared to work the first time with a sample file, but when running the macro on one of my full size lists (3k - 5k rows) it returns 2 rows for each user who started off as a mixture of Yes/No... ?

Both rows will say yes in column G (so that part is correct!) but I have to re-run the macro again on the same dataset for it to remove the duplicate yes rows to get the list as it finally should be!

So I can achieve the result by running it twice, but this is a bit of a cheating way to do it and also the next stage after this involves something similar across multiple worksheets so I need something rock solid to build upon!

View 5 Replies


ADVERTISEMENT

Record Duplicate Values Based On Multiple Conditions Only

May 1, 2014

I am trying to pick out certain bits of information from the below "example" set of data:

A
1

A
1

B
1

C
1

[Code] .......

My aim is to record the letters that are recorded against both numbers (note: in my data there are more than 2 sets of numbers). For the example above the solution would be:

A
1,2

B
1,2

...because these two letters appear against both 1 and 2.

There are some letters that are duplicated against the same number which is making it hard for me to work out. I don't care if the same letter appears against the same number, I just would like to know instances when a letter appears with a different number, and if possible what that number is.

View 3 Replies View Related

Removing Data Based On Multiple Criteria

Mar 30, 2009

I need to remove any rows containing "EEE" in the size column.

I also need to remove any discontinued ("D" in the "Type" column)styles that are currently not in inventory. For example 05-5490 does not have any available in either width "D" or "EW" and should be removed; however, 28-112 does have stock and should remain in the spreadsheet. Anything with an "F" in the "Type" column should be left alone.

View 13 Replies View Related

Removing Duplicate In A String ..

Jan 22, 2009

I would like to combine 3 string together but I would like to remove the duplicate found in any of the string. I attached an example with the desired result. I know =A1&""A2&""&A3 can combine the string, as I wan a space between each string. anyone can further edit my formula to remove the duplicate ...

View 13 Replies View Related

Removing Duplicate Rows?

Apr 14, 2013

Is there way, short of creating a macro, to have duplicate rows deleted in a spreadsheet?

View 3 Replies View Related

Removing Duplicate Fields

Jul 24, 2009

I need to restructure a report that I have imported into Excel.

My columns are titled (from left to right):

Company Name, Account ID, Client Code, Billing Street, Contact Name, Contact Number

There are many rows per Company because every company has many contacts. As a result, for each company, the Company Name, Account ID, Client Code, etc. columns with their associated information in the fields underneath the heading are repeated unnecessarily.

How can I delete the extraneous fields of information (leaving one Company Name field filled out per company) without having to go in an manually deleting them (which would take hours)

View 9 Replies View Related

Removing Duplicate Lines

Aug 19, 2009

I need some adv on how to remove lines that containing duplicate cells. My data is up the max lines of 65536.

I have data in column D that have duplicate value and I need to remove that duplicate line from the list ( thus leaving only unique value). Is there any macro that can do this?

View 9 Replies View Related

Removing Duplicate Entries From Two Lists?

Aug 15, 2008

Let's say I have two mailing lists, A and B.

A:

bob@bob.com
jeff@jeff.com
tom@tom.com
cindy@cindy.com
jose@jose.com

B:

fred@fred.com
jeff@jeff.com
angus@angus.com
cindy@cindy.com
chuck@chuck.com

Now I want to create list C, a modified version of list B, which is made up of everybody in list B, EXCEPT for those people who are also present in list A (in this case, Jeff and Cindy).

So basically list C should look like this:

C:

fred@fred.com
angus@angus.com
chuck@chuck.com


What would be the fastest and most efficient way to create list C?

View 7 Replies View Related

Removing Specific Duplicate Values?

Apr 2, 2013

I have a data set that I add information to weekly. I then add a value at the end of the row, example active or inactive. I've found that, when using the remove duplicate function, it does not always remove the second instance, resulting in a loss of that added data(active or inactive). So I guess my question is, can I somehow specify which instance of duplicated data is removed?

View 6 Replies View Related

Removing Duplicate In From Two Columns Not In Order?

Oct 2, 2013

I have trying to remove duplicate value for two columns which are not in order since long time. I have listed an example for the purpose. Two rows contains same information in different columns. I just wanted to have one row and remove the other with same information.

AAAA
500135500136
500136500135
500137500138
500138500137
500191500192
500192500191
500277500278
500278500277
500413500414
500414500413

View 5 Replies View Related

Removing Unwanted Duplicate Lines

Sep 16, 2009

Hi, I have a report that has multiple lines for the same job with notes of issues and solutions. Each line has a date assosiated with it.

What I need to do is to delete all of the notes apart from the first one. I have attached a sample of the data and highlighted the rows that need to be kept.

I have left the data in it's raw form as it is not always extracted in date order.

Can anyone help me out with a Macro that will sort the data and remove all rows apart from the earliest note per job number?

View 7 Replies View Related

Removing Duplicate Rows, But Keeping The First One.

Feb 28, 2008

I have an excel spreadsheet with approximately 10000 rows. There are approximately 10 columns...

Column A - person's ID number
Column B - name
Column C - Street Address
Column D - City
Column E - State

etc...

It being such a large list there are many many duplicates (it was pulled from a bunch of different excel spreadsheets and combined into one via copy and pasting one document into the other).

I figured out a way to have excel highlight the duplicates in a different color... but scrolling through 10k people and deleting the duplicates is obviously very tedious (approx 40% of the spreadsheet is duplicates).

Is there a way to sort out the duplicates (via their ID number, column A) so that there are no repeats? I want to get rid of the 2nd/3rd/4th (etc) occurance of the person's information but I was to obviously keep the first occurance.

I tried using Advanced Filter but I must have done something wrong because it shrunk the list too far down.

View 9 Replies View Related

Removing Duplicate Words In Individual Cells?

Aug 8, 2014

I have a column that is filled with various car brands that a dealership might sell. The data in the cell may look like CHRYSLER; CHRYSLER; CHRYSLER which I would want to just say CHRYSLER. If the cell says CHRYSLER; FORD; CHRYSLER; FORD I want it to just say CHRYSLER; FORD.

View 1 Replies View Related

Removing Duplicate Records From Customer List

Mar 27, 2008

I have a list of customers that contains duplicate records. These records ALSO include thier addresses WHICH may or may not be identical.

Example: Customer with LAST NAME in A1, FIRST NAME in B1 may be the same person as A2 and B2, however each record may have a different address in column C1 and C2 respectively.

I want to be able to filter out all duplicate customers based soley on the first and last name (data in columns A and B).

View 9 Replies View Related

Removing Duplicate Values From Column - Case Sensitive

May 22, 2013

Suppose I have some data in a column like below

Blue
Red
Green
green
red
RED
BLUE

I need a macro or excel formula so that it will remove duplicate products- case sensitive(removing all duplicate prod using using excel,that i know.) i.e. it should not consider Blue BLUE as duplicate. only consider Blue Blue as duplicate.

So the macro should work same as data -> remove duplicate function already exists in excel, except it will be case sensitive..

View 7 Replies View Related

Removing Duplicate Entries From List Of Names And Addresses

Jun 12, 2006

I'm trying to remove duplicate entries from a list of names & addresses.

What I'm after is some VBA code which will examine row by row the 'post code' field and the 'Full name' field and highlight/delete duplicate entries.

Its best illustrated by an example

Full Name Address Postcode
Mr C. Verougstraete 6 somone st, Leicester HY8 9YK
Mrs R. Brazier 8 high st HY9 9LK
Mr C. Verougstraete 6 somone st, HY8 9YK

The last record is obviously a duplicate of row 2 therefore will be removed.

View 3 Replies View Related

Removing Duplicate Information In Same Cell After Performing VLookup?

Apr 8, 2014

I have used a vlookup code from a past post (Vlookup multiple values in one cell) in VBA and successfully retrieved my information to one cell.

However, I would now like to remove any duplicates in this cell; preferably while running the same code.

--vlookup code
Public Function mVLOOKUP(mlookup_value As Range, mtable_array As Range, mcol_index_num As Long)
Dim r As Range

[Code].....

View 2 Replies View Related

Extract Certain Data Based On Conditions?

Sep 25, 2012

I created a master data sheet to enter data manually to analyze. It contains 20 columns, and rows(continue change, because we enter data all of the days). I need to extract data to another sheet, when the user enters data in the master data sheet, but with some conditions, when the column 6 contain the word ASQ, and then extract all of the data, but the new sheet do not contain 20 columns, because the data that contains the word ASQ have only 16 columns.

View 6 Replies View Related

Extract Certain Data Based On Conditions

Sep 28, 2012

I need to create a macro to extract data from sheet1 to sheet2.

The sheet1 contains 15 columns, and the data starts at row 5.
The sheet2 contains 15 columns, and the data starts at row 5.

We enter data all of the days, so we have like 500 rows in the sheet1.

Only 2 conditions to extract data from sheet1 to sheet2:

if the column9 of the sheet1 contains the word "NO" and column11 of the sheet1 contains the word "ASQ".

View 4 Replies View Related

Extract Certain Data Based On Conditions

Jun 23, 2009

method to extract certain data from a column of values.

The attached workbook has two sheets. From the worksheet named "Data" I would like to be able to extract any values >0.00% and then display the corresponding "model" (C:C) on the other sheet called "Results". I need to be able to achieve this for each day in the month and disregard all other values so I am left with a concise list.

I have manually entered the info for the 1st June as an example.

View 6 Replies View Related

Return Data Based On Two Conditions

Nov 7, 2006

I have very limited vb experience and I believe it’s the only way I can do what I need to get done. I am working on creating an invoice template. I want the price to populate based on two conditions. The two conditions are invoice line quantity and month. Let me provide data ranges. The user will enter a quantity for each invoice line moving down B17, B18, B19, B20 etc up to 24 lines. (through B40). The user will enter a current date in F13. Away from the main body of the invoice:

Range T5 thru T16 will be pre-populated with each month of year 2007. So T5 = 1/1/2007, T6 = 2/1/2007, T7 = 3/1/2007 etc.
Range U5 – U16 will be pre-populated with the line price for each month if the line quantity is less than 10
Range V5 – V16 will be pre-populated with the line price for each month if the line quantity is 10 or more

The price should autopopulate in G17 - G40 where a quantity is placed in the corresponding column range B17 - B40. The number of lines varies per invoice so I'm setting the template up with sufficient lines. As an example, the price should populate for each invoice line beginning in G17 to correspond to the month entered in F13 and quantity entered in B17 based on the corresponding month in T5-T16 and the price in either U5-U16 or V5-V16 given the quantity. So if the Month in F13 was February and the quantity in B17 was 25, the price that populates G17 would come from V6. If the Month in F13 is March and quantity in B17 is 5, the price that populates G17 would be from U7. I just don’t have enough experience to write this myself.

View 7 Replies View Related

Pull Data From One Sheet To Another Based On 4 Conditions

Jul 7, 2014

I am moving along in my masters project and I am having a problem organizing some data I got dumped with.

What I have is a 196 x 196 matrix of the worlds countries and the distance between each one. So each Row has a title header of a country and each column has a country and the cells between the two are the distance of said countries.

On another sheet I have about 10 000 different combinations of dates/years/months ect that I need to populate in order for Stata to work properly.

Rather than manually enter thse in one by one or copy paste what I would like to do is write a code that would do something like this.

If on sheet 2 (the combination sheet) A3 = Afghanistain and C3 = China than F3 = The China/Afghanistain intersection (In this case AN3 on the Distance Sheet)

I am having problems because I can't see to figure out a way to have a program lookup the intersection and give me the China/Afghanistan number based on all the conditions. I am assuming I need to use a matrix lookup of some sort. This way when I do some like Canada/Denmark on the Combination sheet, it will automatically look up and populate the distance from the distance sheet (That being AZ33).

View 10 Replies View Related

Adding Ever Extending Data Based On Conditions

Nov 14, 2008

I work in Local Government and I am recording the contact that we receive for each transaction that are avoidable or unavoidable. This is broken down into service areas.

The data is imported into excel from a database and therefore is constantly growing.

What I want to do it a very basic summary page so that I can group those that are and those that aren't avoidable for each service.

Because the data is ever expanding I would like this on a separate sheet from the actual data.

I attach a sample of the worksheet and would be grateful if someone could advise what formula to use on sheet 2 in cells c4, c5, d4 and d5 to make it do it automatically.

View 5 Replies View Related

Return Data From Table Based On Multiple Conditions

Jul 26, 2014

Want to be able to select data from Column C (3 data validations/drop down menus) and have the corresponding values display in the appropriate fields in column H. Not sure if this is possible?

View 4 Replies View Related

Populate Cells With Data Based On Conditions From Ranges

Oct 13, 2009

What formula do I use to populate certain cells (E5:E10 and J5:10) based on match with condition (E3) with cells from and in the ranges C2:C73 and D2:D73 without creating milelong IF formulas? I am almost at the goal... past 10pm here in Thailand and still at the office

View 2 Replies View Related

Extract Data To Another Sheet Based On Variable Conditions?

Mar 24, 2014

I have some problem with the extraction, I would like to extract the data to another sheet based on variable conditions but I can not do it. My code in just case working if the all conditions are specified. The target is that if want the code could extract the data based on one condition even, or two or three or more.

View 7 Replies View Related

Create Individual Worksheets From Data Based On Conditions

Sep 15, 2009

I’ve created a spreadsheet to record all transactions ( Sheet 1) at a train auction for members only (Sheet 2). Currently, the workbook I created will ‘manually’ create receipts for any buyers/sellers by filling in Member's name in Sheet 1 and then selecting ‘View ‘Member’ Receipt’ button.

Ideally, I would like a macro that will automatically generate a worksheet for any member that has sold or bought an item at the auction and insert worksheets between ‘Start’ & ‘End’ tabs (with option to refresh data) in location order (A-D). Because members come from near and far we would like to generate the members that need to travel the farthest first. Is it possible to create a receipt for only the members that have transactions?

View 4 Replies View Related

Populating Cells When There Are Duplicate Conditions

Oct 22, 2008

if the state, city and company name are the same, I need to make sure the address gets populated in the address column. I have included an attached sheet to clear this up.

For example,

Row 1 is Crazy Horse Saloon in Anchorage, AK and has an address and phone number
Row 2 is Crazy Horse Saloon in Anchorage, AK and does not have an address and phone number

I need it to be able to realize that the State, City, and Business all match and populate the missing information.

View 5 Replies View Related

Delete Duplicate Rows If 3 Conditions Are Same?

Jul 1, 2012

I have a sheet caled "Data", with thousands of rows.

I want to delte any rows that have duplicate rows only if the following data is in the same row but if in column A, coloumn C and column H have the same data

A B C D E F H I
w 1 1 3 4 5 6 7
e 1 1 1 3 4 5 8
w 2 1 5 2 5 6 7

The last row would need to be deleted as dupilcates are A C and H

The data is not sorted.

View 3 Replies View Related

Multiple Identify Duplicate Conditions

Aug 27, 2012

I have a spread sheet in which an account number is located in, lets say, column A. There can be multiple duplicate account numbers here, and thats ok.

However, there is another column, Col. B, which has the name of an action. There are multiple "actions" listed, but the each action can only occur once for each account number. I need to identify if an account number is duplicated and if so, does it have any duplicate values in B. If it does, highlight the duplicates.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved