+ Reply to Thread
Results 1 to 12 of 12

Combining multiple rows into one column without losing data

  1. #1
    Registered User
    Join Date
    10-25-2016
    Location
    Elkhart, Indiana
    MS-Off Ver
    Office Home & Business 2016
    Posts
    4

    Angry Combining multiple rows into one column without losing data

    So, I'm working on a workaround to create patient statements for the business I work for. The current patient statements in Dentrix Ascend are pretty messed up and are too confusing for our customers. I have exported several different reports into excel to get the information I need. The end result of this is to create one row for each patient with all of the data and then to export the complete table into Microsoft Access so I can create a template and print out all of the patient statements from there. My problem is that it is really hard to get the information that I need in the format I need it. I managed to export a document with the charges for each patient, however, there is a separate row for each charge for each patient. I need to move all of the information for each patient from multiple rows to a single row without losing any of the data. There are 4 columns per row: patient name, date, procedure description, and amount. I don't want to combine everything into one column, like I have seen forumns for online. I need each piece of data to stay in their separate cells so I can put a total column at the end. But with roughly 25,000 rows, moving everything manually is a nightmare. Is there ANY way to do this other than manually?

  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: Combining multiple rows into one column without losing data

    Anonymise a small selection of your data (e.g. replace names with A, B, C, etc) and post a sample sheet. 10-20 rows should be plenty.

    Please don't attach a picture of an Excel sheet..

    1. Make sure that your sample data are 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.
    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
    10-25-2016
    Location
    Elkhart, Indiana
    MS-Off Ver
    Office Home & Business 2016
    Posts
    4

    Re: Combining multiple rows into one column without losing data

    Here it is
    Attached Files Attached Files

  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: Combining multiple rows into one column without losing data

    Helper in E2, copied down:
    =IF(OR(A2="",A2=A1),"-",MAX(E$1:E1)+1)

    Formula 1 in G2, coped down:
    =IFERROR(INDEX(A:A,MATCH(ROWS($1:1),E:E,0)),"")

    Array formula 2 in H2, copied across and down:
    =IF($G2="","",IF(COUNTIF($A:$A,$G2)<=INT((COLUMNS($H:H)-1)/3),"",INDEX($B:$D,MATCH(ROWS($1:1),$E:$E,0)+INT((COLUMNS($H:H)-1)/3),MOD(COLUMNS($H:H)-1,3)+1)))

    Array Formulae are a little different from ordinary formulas in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly braces { } appear around the outside of your formula. If you do not CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...

  5. #5
    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: Combining multiple rows into one column without losing data

    This time, with the sheet.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-25-2016
    Location
    Elkhart, Indiana
    MS-Off Ver
    Office Home & Business 2016
    Posts
    4

    Re: Combining multiple rows into one column without losing data

    It didn't work. The E column did change to either FALSE or -, but when I copied and pasted your formula and hit ctrl + shift + enter on G2, all the cells were blank. Same thing for column H.

  7. #7
    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: Combining multiple rows into one column without losing data

    Firstly, do you agree that it worked on the sample sheet? If yes - great: it must be a problem with your implementation of the formulae. If no - then what's wrong with my sheet?

    On your real sheet, is the first data cell A2? If not, whatt is the cell reference?

    You have 4 Qs. Can I have 4 answers, please....

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Combining multiple rows into one column without losing data

    Pl see attached file.

    A38:A44 is A,B,C,D,E,F,G
    ARRAY formula in B38, then dragged across.
    Please Login or Register  to view this content.
    ARRAY formula is used

    To enter ARRAY formula
    Paste the formula
    Press F2
    Press Ctrl+Shift+Enter keys together.
    formula will be covered with{} brackets by excel.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-25-2016
    Location
    Elkhart, Indiana
    MS-Off Ver
    Office Home & Business 2016
    Posts
    4

    Re: Combining multiple rows into one column without losing data

    I haven't tried it in the original yet. In the sample sheet, it seemed to work in column E, but not in G or H. I'm guessing it's a problem with the formula in column G and it piggybacked into column H and beyond.

  10. #10
    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: Combining multiple rows into one column without losing data

    When you opened my sample sheet: was the result as you expected? Yes or no?

    I am reattaching it here...
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 10-25-2016 at 11:17 AM.

  11. #11
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Combining multiple rows into one column without losing data

    pl see my previous post.

  12. #12
    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: Combining multiple rows into one column without losing data

    The formula in G2 is NOT an array formula. The problem is in E2 and down, as it gives a number 1,2,3, etc or a -

+ 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. Replies: 7
    Last Post: 07-23-2013, 02:57 AM
  2. Merging Multiple Rows in a Column without losing text
    By carlc711 in forum Excel General
    Replies: 1
    Last Post: 07-10-2013, 07:05 PM
  3. Replies: 1
    Last Post: 06-05-2013, 08:06 AM
  4. Combining Multiple Rows into one based on specific column.
    By jfirestone in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-13-2012, 11:40 AM
  5. Combining multiple rows of data into one row
    By RudyDLG in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-16-2012, 12:32 AM
  6. Combining data from multiple rows
    By dmaddux in forum Excel General
    Replies: 1
    Last Post: 08-30-2011, 06:44 PM
  7. Combining multiple rows with different data into one
    By Dumb Blond in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-30-2011, 06:05 PM
  8. combining data from multiple rows
    By trsteele in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-17-2010, 02:13 PM

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