+ Reply to Thread
Results 1 to 7 of 7

converting multiple rows to one row?

  1. #1
    Registered User
    Join Date
    08-25-2018
    Location
    Duhok, Iraq
    MS-Off Ver
    excel 2016
    Posts
    4

    converting multiple rows to one row?

    Hello guys
    I have data similar to the following data, how to covert multiple rows to one row?

    Capture.JPG

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: converting multiple rows to one row?

    How does this look?

    =IFERROR(INDIRECT(TEXT(AGGREGATE(15,6,(ROW($A$2:$E$4)*100+COLUMN($A$2:$E$4))/($A$2:$E$4<>0),COLUMNS($H2:H2)),"R0C00"),FALSE),"")

    See sheet, and remember: you may need ; instead of , Also R and C may need to be altered depending on your regional settings.
    Attached Images Attached Images
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    08-25-2018
    Location
    Duhok, Iraq
    MS-Off Ver
    excel 2016
    Posts
    4

    Re: converting multiple rows to one row?

    Thanks for replying
    But I have many data (see attached figure)like in the figure i attached , I can not write the formula you gave me to all, I need an easier way to do that

    Best regards
    NawzadCapture.JPG

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: converting multiple rows to one row?

    Will you please attach a SMALL sample Excel workbook (in your case 5-10 BLOCKS of data will be enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

  5. #5
    Registered User
    Join Date
    08-25-2018
    Location
    Duhok, Iraq
    MS-Off Ver
    excel 2016
    Posts
    4

    Re: converting multiple rows to one row?

    I have used VBA code and it worked... thanks a lot

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: converting multiple rows to one row?

    Please share yiur solution so that others can benefit from it.

  7. #7
    Registered User
    Join Date
    08-25-2018
    Location
    Duhok, Iraq
    MS-Off Ver
    excel 2016
    Posts
    4

    Re: converting multiple rows to one row?

    With pleasure

    I can not attache the link yet because I am new,so I will copy the answer from a website:
    #Solution

    The following VBA code also can help you convert a range of data to one row.

    1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

    2. Click Insert > Module, and paste the following code in the Module window.

    Sub TransformOneRow()
    'Updateby20131120
    Dim InputRng As Range, OutRng As Range
    xTitleId = "KutoolsforExcel"
    Set InputRng = Application.Selection
    Set InputRng = Application.InputBox("Ranges to be transform :", xTitleId, InputRng.Address, Type:=8)
    Set OutRng = Application.InputBox("Paste to (single cell):", xTitleId, Type:=8)
    Application.ScreenUpdating = False
    xRows = InputRng.Rows.Count
    xCols = InputRng.Columns.Count
    For i = 1 To xRows
    InputRng.Rows(i).Copy OutRng
    Set OutRng = OutRng.Offset(0, xCols + 0)
    Next
    Application.ScreenUpdating = True
    End Sub

    3. Then press F5 key to run the code, a dialog is popped out for you to select a range of contents you want to convert into a row, and click Ok,
    another popped-up dialog is for you to select a single cell to put out the result. See screenshots:

    Capture.JPG

    Capture.JPG

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Converting Rows Into Multiple Rows - Large Data Set
    By nisiwi in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-21-2014, 04:53 PM
  2. Converting multiple columns to rows
    By varunarora21 in forum Excel General
    Replies: 7
    Last Post: 02-13-2014, 06:17 AM
  3. Converting a row into multiple rows
    By pedram_i7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-14-2013, 10:27 AM
  4. Converting multiple columns to rows / Converting to Panel Data
    By Stuart11 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-14-2013, 05:50 AM
  5. Excel 2007 : converting multiple columns to multiple rows
    By jakee7987 in forum Excel General
    Replies: 6
    Last Post: 07-11-2012, 10:51 AM
  6. Replies: 2
    Last Post: 08-19-2011, 10:22 AM
  7. Converting columns to rows for multiple rows
    By khscruz in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-04-2011, 11:59 AM
  8. Converting multiple columns into multiple rows
    By papagrande3 in forum Excel General
    Replies: 7
    Last Post: 08-20-2010, 01:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1