Code To Find Duplicates And Concatenate In One Row

Nov 20, 2013

I have a table that looks like this:

ID
HostLocation
NDaysinHost
marina.silva
USA
100

[Code]....

I would like to obtain a table in the following format where I can find

ID HostLocation NDaysinHost
marina.silva USA, Norway, Bolivia, Italy, Ecuador... 100,45,67,8,9...
tatiana.gottig Venezuela, Chile, Peru, Canada 89,54,32,6

Searching in the net I found the following code:

VB:
Sub groupConcat()Dim dc As Object
Dim inputArray As Variant
Dim i As Integer
Set dc = CreateObject("Scripting.Dictionary")
inputArray = WorksheetFunction.Transpose(Sheets(1).Range("A2:C9").Value)

[Code]....

However I only obtain the first two columns concatenated. It says that for more columns repeat the loop, however I did and the result was not the expected, it returned me the same two columns again concatenated. How can I arrange this to fit my criteria?

View 1 Replies


ADVERTISEMENT

Concatenate Duplicates: Concatenate Results Of All Equal P/N's From Any Given List

Oct 6, 2007

I have a list of P/N's that are used in more then one location. and it's sorted by P/N's.

ColA__ColB__ColC
______Loc___PN
______1_____A
______2_____A
______3_____B
______4_____C
______5_____C

I Want to be able to put in Col A the concatenate results of all equal P/N's from any given list. Or at least select the few cells that i know are duplicates and from that copy the Location to a single Column.

ColA ColB__ColC
______Loc__PN
1,2____1___A
_______2___A
_______3___B
4,5____4___C
_______5___C

View 5 Replies View Related

Code To Find Duplicates

Mar 26, 2007

I’m looking for a code that finds all duplicate words in column A & B and change the font of the found duplicate word in column B to ColorIndex = 11 and .FontStyle = “Bold”

I need this code to run frequently and possibly we can combine it with http://www.mrexcel.com/board2/viewto...272792#1272792

The wb is a dictionary and as I’m adding new words in new rows the wb needs to update. It is of course mostly important it updates when I open the wb, but it would be interesting if it could update for every new row (word) added as I might not want to close and re-open the wb just for this.

View 9 Replies View Related

Code To Find Duplicates In Worksheets And Loop

Apr 27, 2007

I am trying to write a macro that will find duplicate listings in two worksheets by row. I don't really want to do a user form unless I have to.

View 9 Replies View Related

Concatenate Cells And Remove Duplicates

Jun 23, 2014

I currently have a spreadsheet that contains about 1700 lines of data related to ~400 different clients which I am looking to consolidate.

The data is currently in this format (a set like this repeated ~400 times with anywhere between 3 and 7 services):

Company ID #
Company Name
Service1

Company ID #
Company Name
Service2

Company ID #
Company Name
Service3

I would like to have the data in this format (one row per company with all of the services in the third column concatenated into a single cell, all while removing the duplicate rows.)

Company ID #
Company Name
Service1, Service2, Service3

How to create the code (or describe the process) necessary to do this?

View 5 Replies View Related

Concatenate Cells And Delete Duplicates

Apr 1, 2009

I have an excel 2007 spreadsheet that lists
items on multiple rows for the same customer.

Each sheet will list anywhere from 25 to 100 individual customers.

I need to identify the duplicates, concatenate
the "Items" to a single cell on the first row, and
delete the duplicate rows. eg:

Cust #| Item
1 | A
1 | B
1 | C
2 | B
2 | E
3 | A
3 | C
3 | E

The result should look like:

Cust# | New Item
1 | A, B, C
2 | B, E
3 | A, C, E

View 14 Replies View Related

Concatenate Duplicates + Delete + More Steps

Oct 15, 2009

I have 2 columns of data with 7,000 rows that I am trying to manipulate in the following way. The first column contains a list of car manufacturers (not really my example, but involves the same concept). The second column contains a list of different models of cars. For instance,

Ford | Taurus
Chevrolet | Avalanche
Saturn | Sky
Ford | Explorer
Honda | Accord
Ford | Taurus

What I want is a list of 2 columns with UNIQUE car manufacturers in first column with a list of UNIQUE car models (comma delimited) in second column. So for this example, the first row could read " Ford | Taurus,Explorer". I don't want Taurus to appear twice. I got a lot of help from JBeaucaire from this post. I just can't add the ability to remove car models from the list also. Thanks in advance for all the help!

View 7 Replies View Related

Concatenate Non-adjacent Cells Without Duplicates

Nov 17, 2009

I've been working on a spreadsheet that is used to track the application process of numerous clients. In doing this, I have a row at the top of each client that is used as a sumarry column. Below each cell in the top row, I have up to 30 non-adjacent cells that I'm trying to concatenate in the top cell separated by new lines. I'm also wanting to not display any duplicates, as there are up to only 5 steps that could be shown for each record. I found a UDF that will search an array and return only the unique values, but it accepts the data as an array, and it returns it as an array also. I seem to be having trouble passing the array from the sheet as well as formatting and returning the array with line breaks.

In the worksheet cell: ....

View 10 Replies View Related

Concatenate Cells Then Determine Duplicates?

Oct 14, 2013

I need to detect 2 levels of duplication.

I have a data table that is similar to below (actual table is very large 1000+ rows) but duplicate column is empty.

I don't want to add additional data (i.e. formula to perform concatenate) to other columns as it takes a very long time even with screen updating turned off.

I want to use vba to
1) determine how many rows there are in the worksheet (this updates from an outside datasource)
2) Concatenate baseno & altno and determine if the concatenated value is duplicated
3) Within those duplicates for each baseno&altno pair determine if verno is different
4) Set "Duplicate" value for each duped baseno&altno pair where verno is different

So the end resulting table after macro runs would be

baseno
altno
verno
duplicate

[Code]....

I have been for weeks now and just can't get this to work. I can get it so that I can determine duplicates on one column but I can't seem to get it to concatenate inside the script and compare without writing back to the sheet (which is too slow and I don't want to do).

View 8 Replies View Related

Concatenate Varying Numbers Of Cells Based On Duplicates Found In Separate Column

Jul 25, 2011

I need to concatenate varying numbers of cells based on duplicates found in a separate column, but I'm not sure how to approach it. I have 41,000+ rows of data, so I have to find a formula.

Example:

1AB2Denton, PaulFB357D4D3OwensTest, MarcyFB539F934Brennan,
JosephFB539F935Bowser, AmyFB539F936LaRock, ChuckFB667D3B

Based on duplicates in column B, I want to combine the data in column A into one cell. The duplicates in column B could be only 2, or could be 20+.

View 2 Replies View Related

Remove Duplicates From Column 1 And Concatenate Column 2?

Mar 12, 2014

My issue is that I have 1200+ addresses to make more readable - the first column is the street name, the second is the post code(s) relative to the street - what Ideally I'd like to achieve is one row per street, the street name followed by the post codes... i.e. take this...

A33 Relief RoadRG2 0RR
Abbey SquareRG1 3AG
Abbey SquareRG1 3BE
Abbey SquareRG1 3BQ
Abbey SquareRG1 3FB
Abbey StreetRG1 3AN
Abbey StreetRG1 3BA
Abbey StreetRG1 3BD
Abbots WalkRG1 3HW
Aberford CloseRG30 2NX
Admirals CourtRG1 6SP
Admirals CourtRG1 6SR
Admirals CourtRG1 6SS
Admirals CourtRG1 6SW
Ainsdale CrescentRG30 3NG
Alan PlaceRG30 3BW
Albany RoadRG30 2UL

to this...

A33 Relief RoadRG2 0RR
Abbey SquareRG1 3AG, RG1 3BE, RG1 3BQRG1 3FB
Abbey StreetRG1 3AN, RG1 3BA, RG1 3BD
Abbots WalkRG1 3HW
Aberford CloseRG30 2NX
Admirals CourtRG1 6SP, RG1 6SR, RG1 6SS, RG1 6SW
Ainsdale CrescentRG30 3NG
Alan PlaceRG30 3BW
Albany RoadRG30 2UL

View 5 Replies View Related

Find In Table, Then Concatenate Results

Jun 13, 2009

My data is pulled in as a table from QuickBooks, so its many rows consisting of many column entries per row. The columns are laid out like:

DUEDATE, VENDOR, ISPAID, PONUMBER, AMOUNT

I currently have a SUMIFS formula that works well for searching the table and finding PO's that are not paid, for a specific vendor, on a day today or before, and it ads the amounts together and returns the sum opf the amounts for me.

Now, what I would also like to do is to have it return the PO numbers as a concatenated text string all into one cell. So, it shoudl find all the rows where the due date is today or before, the PO has not been paid, and the vendor is a specific vendor, and then concatenate all of the PO numbers into one cell of my choosing.

This sounds just like the SUMIFS function, however, the SUMIFS function adds the values and places the sum in the cell of my choosing. For this, I would like the values found (which are text values) to be concatenated into one cell.

View 9 Replies View Related

Concatenate Function To Cell Macro Code

Mar 8, 2008

Need to take column J20:J255 and column K20:K255 and concatenate into activesheet K20:K255. This needs to happen when OptionButton1.Value=True. The information in each cell will be different. The following code works well, but it will not allow me to put a space in between the two strings.

Private Sub OptionButton2_Click()
Dim DescriptionCell As Range
Set DescriptionCell = ActiveSheet.Range("D20:D54")
If OptionButton2.Value = True Then
With DescriptionCell
.NumberFormat = General
.Formula = "=CONCATENATE('Bill of Materials-3'!F20,'Bill of Materials-3'!I20)"
End With
End If
End Sub

View 2 Replies View Related

Find Multiple Text Values & Concatenate To Each Row

Mar 31, 2009

I am trying to find 3 values (X,Y,Z) in row A and concatenate those three values in column A for the entire range below, say A2:A100.

View 9 Replies View Related

Concatenate-Join Quote Marks Around Text Code

Oct 10, 2006

Trying to build array elements from a list

19909
19953
etc

My thought is in helper column to concatenate the quotes and comma "xxxxx", Then I will copy paste special transpose and should have an array list

I tried ="""&A2&"","
Returns
"&A2&",
But I need it to return "19909",

View 4 Replies View Related

Find Last Value In Row With Duplicates?

Jul 6, 2014

I have a sheet with numbers in descending orders with duplicate in one row and their respective value in 22nd row. I want to find the2nd occurrence of that value. (max. occurrence2 is 2)

Foe example

5----4-----3-----3-----2-----2-----1
A----B-----0---- C-----0-----D-----E

So if i lockup value "3" C should be returned (not 0) and for 2 "D"

see attached also

View 5 Replies View Related

Find If Duplicate Values Exist In A Column, Concatenate Cells And Then Delete

Dec 17, 2009

I want to do, is search column A for claim numbers that match. When I do have a matching claim number, I want to concatenate the original cells ownership field with the said matching cells ownership field (or move into a column in the same row, I can always concatenate later). Once that is complete, I want to delete the row I took the information out of.

I want to join this data in ArcGIS, but as of right now, it's not a 1-to-1 relationship, so only a relate works. That doesn't help me as I want to display claims by ownership, and this can vary per claim. Company A may have 100% on one claim, and then split another claim 50% with Company B.

This causes a double entry on the claim field in this current spreadsheet I have, which requires me to clean it up by making multiple columns of ownership vs. an additional row for shared ownership.

My problem:

Column A Column B
1235555 Company A (50%)
1235555 Company B (50%)
1235556 Company A (100%)
1235557 Company A (33%)
1235557 Company B (33%)
1235557 Company C (33%)

What I would like to see

Column A Column B Column C Column D
1235555 Company A (50%) Company B (50%)
1235556 Company A (100%)
1235557 Company A (33%) Company B (33%) Company C (33%)

View 3 Replies View Related

VBA Code To Remove Duplicates

May 14, 2006

Private Sub Dupe_Remover()
'29/06/2005 by nhunter

Application. ScreenUpdating = False
Dim R1 As Range
Dim drow As Integer
Dim lastitem As String

Set R1 = ActiveCell

loopst:

If Trim(ActiveCell) = "" Then
Goto procend
End If............

View 9 Replies View Related

Find Duplicates Formula..

Mar 13, 2009

I have two columns of email addresses and I want to make sure that between these two columns there are no duplicates.

View 4 Replies View Related

Find Duplicates By Name And Date

Sep 28, 2009

I have a number of tables that may or may not have multiple dupliate enters, I am trying to indentify by name and by date. None of the tables are in the same format, which makes it ever harder for me, but all I want is a return of "duplicate" or "original", this will allow me to have acloser look at the duplicates.

View 7 Replies View Related

Formula For Find The Duplicates

Dec 20, 2007

I have excel sheets that will show a customer account number an ammount they need to pay and there full name and a date when the payment is expected, is there a formula that will find duplicates, if the same entry has been put in twice

View 14 Replies View Related

Find Duplicates And Color It

Mar 4, 2008

is there a way to create a condiction that will check in a colum if there are 3 or more duplicates and color coded to like red.....

I can do duplicates in general but i do not what to know about the 2 that are equal i want to know if there are 3 or more.

View 9 Replies View Related

Find The Duplicates Values

Jul 18, 2008

I have a long list of checks and I need to find the duplicates, determine how many dupicates there are for a given check (the criteria is if the ENTIRE ROW is dupicated), and highlight HALF of the duplicated rows.

I am able to sort the table however needed.

Here is the logic I was thinking of following..

If Row is Duplicated
Select Case Boolean
Case True
Count how many are duplicated
If count is even then
NumberToDelete = Count*0.5
For i = 1 to NumberToDelete
Highlight one of the duplicated rows in red background
Next i
Else
Next Record (do not highlight anything)
End If
Case False
'Nothing
End Select
End If

View 11 Replies View Related

Find Duplicates In One Particular Column

Dec 4, 2008

I'm trying to find duplicates in one particular column. I'm using this formula =if(countif($A$1:$A:$300,A1)=1,FALSE,COUNTIF($A1:A1,A1)=1) in the conditioning format tool but here's my problem:

I'm noticing that some of the cell values have spaces after the entries so the formula is not picking it up as a duplicate. Is there a quick way to remove those unwanted spaces after each entry?

View 9 Replies View Related

Find And Mark Duplicates

Dec 16, 2008

I need to find duplicates subnet information in row F and mark the words "Duplicate"
Then I need to do the same with Row K. I need to find any duplicate subnet masks.

The reason for this is that I merged two orginizations into one spreadsheet and I need to find the duplicates in Company A and Company B's subnet and mask information.

View 9 Replies View Related

Formula Or VBA Code To Remove Duplicates?

Apr 10, 2014

I have a set of text in rows which includes duplicates like this:

Column A
Text 1
Text2
Text1
Text500
Text500

I then need to remove the duplicates and put them in column B. I normally use the remove duplicates button in Excel to do this but seeing as I have to do this task every day, I was hoping there would be either a formula or VBA solution which automatically does this?

View 4 Replies View Related

Code To Check For Duplicates In Column

Jun 10, 2014

Obviously there is the Remove Duplicates option but I want something a bit different plus this option won't be available as the workbook is on complete lockdown.

There will always only be 214 rows to check in column B and the data cannot be sorted or it will mess a lot of things up!

Just wondering if there's some code that can check for duplicate entries because for the workbook to work, each row must have a different entry.

When the user selects this sheet a message box pops up telling them they can't have two or more entries the same but I feel this isn't enough as there's nothing actually stopping them doing this.

View 2 Replies View Related

Code To Highlight Duplicates With Colors

Jun 12, 2014

I am using below code to highlight duplicates with different colors.

I want to change the range in B3:C2000

[Code] .....

View 3 Replies View Related

Compare Two Coulmns & Find Duplicates.

May 13, 2009

I have a sheet which contains more than 8000 names (in 1 column), & another sheet which contains around 600 names (in 1 column), is there any way wherein i can compare both the columns & find out duplicates if any?

Sheet which contains 8000 names contains duplicate cells as well, but dat doesn't matter, i jst need to compare & confirm the sheet which has 600 names should be unique (Not included in 8000 data)

View 5 Replies View Related

Find And Hide Rows With Duplicates

Aug 28, 2009

I want to search a worksheet for rows that share the same value in two columns (columns C and E). See the attached excel file.

I have highlighted in yellow some rows that have duplicate values in row C and E.
So in this case rows 14 and 19 will be hidden but rows 13 and 17 will still be visible.

Note that this must work properly reguardless of how the data is sorted.

In other words, there can never be more than one row that has the exact same value for both column C and E.

View 6 Replies View Related







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