+ Reply to Thread
Results 1 to 13 of 13

Help Rearranging data into rows from 2 columns

  1. #1
    Registered User
    Join Date
    08-01-2022
    Location
    Lancashire, England
    MS-Off Ver
    365
    Posts
    24

    Help Rearranging data into rows from 2 columns

    Hi, I am Gary and I am new here, although I have been using the site for months and have picked up a lot of information as I am a novice. I have been working on a sheet that reads a csv file and uses a lot of =IF formulas and then ticks certain boxes, transfers phrases etc and I was really happy with how I was getting on but then the csv has all been changed and the data is not reliable. My only option now is to copy information from an email I receive and hand transfer the information.

    I have realized that I can use the formulas I have created originally in a new sheet but only if I can get the data to display correctly and I am really struggling after searching the internet and this site.

    I have attached the spreadsheet with the data I need help with. This is a passenger booking system where it tells me who they are, where they are travelling to and from, times, disabilities and other data.

    When I paste the data, it forms into 2 columns that are 15 rows per passenger. A1 to A15 and B1 to B15.

    Firstly, I need the information in B1 to B15 to stack below the data in A1 to A15 and then I need it to transpose so all that data is in row 1. I can do this manually but it is time consuming as sometimes I could have over 100 of these.

    Secondly I need it to do the same for each passenger. EG, passenger A in row 1, Passenger B in row 2 etc

    Also, this seems to leave the same columns blank for each passenger, so I need it to delete the blank columns as they will always be the same and of no use.

    If anyone can help then I would be grateful, as it means i can then use my old formulas to read this new data.

    Thank you
    Attached Files Attached Files

  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 2403
    Posts
    44,139

    Re: Help Rearranging data into rows from 2 columns

    A1:

    =INDEX('Example 3 Person'!A:A,SEQUENCE(COUNTIF('Example 3 Person'!A:A,"Pax Leg Origin*"),15))&""

    S1:

    =LET(C,COUNTIF('Example 3 Person'!A:A,"Pax Leg Origin*"),INDEX('Example 3 Person'!B:B,SEQUENCE(3,4,5)+SEQUENCE(3,1,0,11))&"")
    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-01-2022
    Location
    Lancashire, England
    MS-Off Ver
    365
    Posts
    24

    Re: Help Rearranging data into rows from 2 columns

    Hi Glenn, This is amazing and i have it working now but not 100%. When i paste the formula in A1 on a sheet with 24 journeys, it does exactly what i want it to do. But when i then paste the S1 formula, it only copies the first 3 journeys and doesnt read the rest. Is it something i am doing wrong. I have tried to drag the formula down but i get a #spill!
    Thank you Gary

  4. #4
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Help Rearranging data into rows from 2 columns

    Only the finishing touch wasn't done yet (change 3 --> C) [two times]

    correct is
    Please Login or Register  to view this content.
    This should work in case of more than 3 forms.
    Last edited by HansDouwe; 08-02-2022 at 10:06 PM.

  5. #5
    Registered User
    Join Date
    08-01-2022
    Location
    Lancashire, England
    MS-Off Ver
    365
    Posts
    24

    Re: Help Rearranging data into rows from 2 columns

    Hansdouwe, thank you so much.

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Help Rearranging data into rows from 2 columns

    Glad it work now.
    Thx for the rep.

  7. #7
    Registered User
    Join Date
    08-01-2022
    Location
    Lancashire, England
    MS-Off Ver
    365
    Posts
    24

    Re: Help Rearranging data into rows from 2 columns

    Ok, I am sorry for this but I have hit a snag... We have today changed over to a web based email. This means that when I copy the data from the email, it is now different and has a few more blanks..

    I still need the same thing to happen, all the data that is in column B to stack under the data in column A and then to transpose into a row. I need a new new row for each passenger. The old format had 15 rows but the new format is different.

    The new format seems to have a small anomaly. For the first passenger, the data is in A1 to A16 and B1 to B16 as there is no gap between the data in A4 ("arrive" or "Depart") and A5 ("pax leg origin"), all other passengers have a gap between the "arrive" or "depart" cell and the "pax leg origin" cell.

    To even things up, I could manually add a row between A4 and A5 and then there would be symmetry for all passengers.

    The main thing now though is that the 2 formulas provided dont work.

    Can you help me out with the corrected formulas please?
    Attached Files Attached Files

  8. #8
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Help Rearranging data into rows from 2 columns

    Quote Originally Posted by worth1g View Post
    For the first passenger, the data is in A1 to A16 and B1 to B16 as there is no gap between the data in A4 ("arrive" or "Depart") and A5 ("pax leg origin"), all other passengers have a gap between the "arrive" or "depart" cell and the "pax leg origin" cell.
    Its important the forms of all passengers have the same lay-out.
    Decide which layout you want to start with and where you want to go and a similar formula can be created for that.

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

    Re: Help Rearranging data into rows from 2 columns

    Give the expected result for the file in Post#7.
    VBA solution is ok?
    Last edited by kvsrinivasamurthy; 08-04-2022 at 02:32 AM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  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 2403
    Posts
    44,139

    Re: Help Rearranging data into rows from 2 columns

    This is probably do-able without huge effort. Indeed, it might be easier, depending on your reply!!

    However, you need to be CLEAR about the desired output.

    Provide 1 row of desired output (and state CLEARLY if you really NEED the blank column (column C) in the original sheet, IF the file does not work for you.
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 08-04-2022 at 02:21 AM.

  11. #11
    Registered User
    Join Date
    08-01-2022
    Location
    Lancashire, England
    MS-Off Ver
    365
    Posts
    24

    Re: Help Rearranging data into rows from 2 columns

    Hi Glenn, This seems to work perfectly. I do not need any of the blank columns. They appear in the same column every time and are just surplus so they are not needed.
    I cant thank you enough for all the help.
    I am now going to put this into the form i created last time and amend the formulas in that form.
    I may need help with the final bit of that form too but i will create a new post when i am at that point. Thanks again.

  12. #12
    Registered User
    Join Date
    08-01-2022
    Location
    Lancashire, England
    MS-Off Ver
    365
    Posts
    24

    Re: Help Rearranging data into rows from 2 columns

    Quote Originally Posted by kvsrinivasamurthy View Post
    Give the expected result for the file in Post#7.
    VBA solution is ok?
    Thanks for the reply, Glenn has managed to sort this below. I may be creating a new post at some point as i know what i am doing with this data but there is one part i am stuck with. I just need to complete the form first.

  13. #13
    Registered User
    Join Date
    08-01-2022
    Location
    Lancashire, England
    MS-Off Ver
    365
    Posts
    24

    Re: Help Rearranging data into rows from 2 columns

    Thanks for the reply, Glenn has managed to sort this below. I may be creating a new post at some point as i know what i am doing with this data but there is one part i am stuck with. I just need to complete the form first.

+ 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. [SOLVED] Rearranging Columns into rows or reading data from external source
    By Daniel Brown in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2014, 05:43 AM
  2. rearranging data in the row to be in columns
    By melody10 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-28-2013, 09:55 AM
  3. Rearranging data from multiple rows to columns
    By tessda in forum Excel General
    Replies: 2
    Last Post: 09-17-2011, 12:58 AM
  4. Rearranging the cells of rows into columns
    By shacky in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-12-2010, 03:35 AM
  5. Splitting cells, rearranging columns and rows, cleaning up data
    By daniel.henriksen in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-11-2010, 03:55 AM
  6. Rearranging columns to rows
    By joshuar in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 01-11-2010, 10:23 AM
  7. Rearranging columns/rows
    By BernieH in forum Excel General
    Replies: 1
    Last Post: 02-09-2006, 05:20 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