You are here:

Excel/merge rows based on cell

Advertisement


Question
If I have data like this (5 columns):

35   1   2   3   4
35   5   6   7   8
35   9  10  11  12
40  13  14  15  16
40  17  18  19  20
42  21  22  23  24
42  25  26  27  28
42  29  30  31  32

and I needed this result below by comparing the firt column, what formula would I use?

35   1   2   3   4   5   6   7   8   9  10  11  12  
40  13  14  15  16  17  18  19  20
42  21  22  23  24  25  26  27  28  29  30  31  32

Thanks!

Answer
With the variable length of data, I'm not able to think of a normal function that would do this - my SUGGESTION would be to use a macro to get the data transformed - if that is an acceptable solution, I'm happy to write such a macro - is the original data already sorted, or would it need to check all rows for a match?
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Aidan Heritage

Expertise

I have provided first hand support since `95 for Microsoft Office majoring in Word and Excel - support for all versions from 2 onwards. I'm based in the UK, so please allow for time differences when asking me questions from other parts of the world!

Experience

My background is in the insurance industry and call centre areas, but have been called upon to provide many varied solutions.

Education/Credentials
I'm educated to UK A level standard, but as I left school some 30 years ago that is rather irrelevent - university of life has provided more of a background!

©2016 About.com. All rights reserved.