Merging multiple rows of data.

vip

New Member
Joined
Aug 3, 2007
Messages
7
I have a data file that contains transactions, and some of the transactions are for the same vendor. I would like to 1) locate all of the duplicate vendor IDs, 2) merge the multiple rows of data into a single row, using concatenate, sum, etc, 3) paste the new single row as a value, and 4) delete the multiple rows of data.

The issue is complicated by the fact that the number of rows containing data for a single vendor can run from 1 to 50, so merging the data becomes more difficult.

A brief sample is attached.
Data for looping test.xls
ABCDEFGH
4DuplicateIDCheckNbrCheckDateVendorNameRefNbrInvoiceNumberInvoiceDateAmountPaid
53404/04/2007Vendor#10180920107AA4/1/20077.20
63504/04/2007Vendor#20180951050242/28/20072.89
73604/04/2007Vendor#30180962607RB3/26/20072.00
813604/04/2007Vendor#30180972707RB3/27/20073.78
923604/04/2007Vendor#30180982907RB3/29/20073.74
104104/04/2007Vendor#80181032399433/11/200760.60
1114104/04/2007Vendor#80181042410013/18/200751.90
124604/11/2007Vendor#130181082158833/2/200760.44
1314604/11/2007Vendor#130181092161493/16/200710.50
144704/11/2007Vendor#14018110903-043/19/200716.95
155904/18/2007Vendor#260181221915743/28/20070.20
1615904/18/2007Vendor#260181231819893/28/20071.31
176204/18/2007Vendor#29018126V271273/24/20070.26
1816204/18/2007Vendor#290181275961273/24/20070.73
1926204/18/2007Vendor#290180940107JV4/1/20076.00
2036204/18/2007Vendor#290181282707RW3/27/20071.15
2146204/18/2007Vendor#290181297721843/20/200777.11
Data (2)
[/url]
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
Why not just Data>Pivot table...?
 
Upvote 0

vip

New Member
Joined
Aug 3, 2007
Messages
7
I appreciate the pivot table idea.
The data will be used to 1) create text files for transmitting data to 3rd parties, and 2) help with vlookup items.
I've not dealt enough with pivot tables to know if that will solve my issue, but I'd like to keep the reported data in the same 'view'.
 
Upvote 0

vip

New Member
Joined
Aug 3, 2007
Messages
7
The critical pieces of info include:
Vendor ID
Invoice #s
Check #s
Check Dates
Amt Paid
 
Upvote 0

Dan Waterloo

Well-known Member
Joined
Jan 4, 2007
Messages
876
Based on the 21 rows of data in the sample dataset that we can see, what should the resultant "merged" dataset look like?
 
Upvote 0

vip

New Member
Joined
Aug 3, 2007
Messages
7
Here is the result of manually merging the rows of multiple transactions per vendor:
The different colors represent the different # of rows of data merged.
Data for looping test.xls
ABCDEFGH
50DuplicateIDCheckNbrCheckDateVendorNameRefNbrInvoiceNumberInvoiceDateAmountPaid
513404/04/2007Vendor#10180920107AA4/1/20077.20
523504/04/2007Vendor#20180951050242/28/20072.89
533604/04/2007,04/04/2007,04/04/2007Vendor#3018096,018097,0180982607RB,2707RB,2907RB3/26/2007,3/27/2007,3/29/20079.52
544104/04/2007,04/04/2007Vendor#8018103,018104239943,2410013/11/2007,3/18/2007112.50
554604/11/2007,04/11/2007Vendor#13018108,018109215883,2161493/2/2007,3/16/200770.94
564704/11/2007Vendor#14018110903-043/19/200716.95
575904/18/2007,04/18/2007Vendor#26018122,018123191574,1819893/28/2007,3/28/20071.51
586204/18/2007,04/18/2007,04/18/2007,04/18/2007,04/18/2007Vendor#29018126,018127,018094,018128,018129V27127,596127,0107JV,2707RW,7721843/24/2007,3/24/2007,4/1/2007,3/27/2007,3/20/200785.24
Data (2)
 
Upvote 0

Dan Waterloo

Well-known Member
Joined
Jan 4, 2007
Messages
876
Okay, I see what you mean now.

In order to accomplish this I believe that you would need to use VBA. That is much more complex than learning to use pivot tables.

Also, I question the usefulness of concatenating 25 or 50 dates together (and then also 25 or 50 invoice numbers.) For one thing, you would no longer see which invoice number lines up with which Check Date or which Ref Nbr, etc.

I still recommend doing this in a pivot table.
 
Upvote 0

Forum statistics

Threads
1,191,484
Messages
5,986,854
Members
440,053
Latest member
jhollingworth

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
Top