...

View Full Version : Excel - Merging Rows query



sonofjack
09-01-2009, 04:35 PM
Is there a function where you can combine rows of data on an Excel worksheet based on the condition/rule of them sharing the same data in certain cells?

eg
I want to combine rows such as the below....

1 TEST DATA Sep-09 UK
2 TEST DATA Sep-09 UK
1 NEW TEST NEW DATA Nov-09 US
2 NEW TEST NEW DATA Nov-09 US

so they look like this

1 2 TEST DATA Sep-09 UK
1 2 NEW TEST NEW DATA Nov-09 UK

This is to be a a formula or a function I can write into a macro so I want it to be something like "combine rows where cells in column E contain shared data" for example.

Thanks

everweb
09-04-2009, 09:49 PM
Are there always 2 rows that match ? Can there be single rows with no match ? Can there be 3 matching rows ?

In your example, you appear to be moving all the cells to the right to make room for the contents of 'column A' from the matching row. How would this look for different numbers of matching rows ?

In your example, you have matching data in other columns as well as column E. Is that relevant ? Would the following be classified as matching rows ?:
1 TEST DATA Sep-09 UK
2 DEV Datum AUG-09 UK
If so, what would appear in columns B,C,D ?

sonofjack
09-11-2009, 05:49 PM
Hi Everweb.
Thanks for the reply.
There aren't always two rows that match.
I have actually now worked it out by having an IF statement in a new column for each row which looks to see if a cell matches the one below it. If it does then it adds a word/letter to the cell. Then I can filter the page and have unique records etc.
So I've managed to do it with a mixture of formula and macro work.
Thanks anyway



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum