+ Reply to Thread
Results 1 to 12 of 12

Reordering data and combining with another spreadsheet

  1. #1
    Registered User
    Join Date
    05-16-2016
    Location
    Maidstone, England
    MS-Off Ver
    15.2 for Mac
    Posts
    6

    Reordering data and combining with another spreadsheet

    Hi all,

    Please be kind, I can do VERY basic excel stuff but don't really know to start with this so I'm hoping it's all rather easy and some kind soul can point me in the right direction.

    Problem: I have two databases that I want to combine data from to be able to do some statistical comparisons.

    The first (DB1) has a list of subjects with outcomes (one subject per row, outcome in a separate column). Pretty simple.
    The second (DB2) has lots of results of a particular test in chronological order (each has its own row) but a particular subject may have several results, each being on a unique row.

    Firstly, I need to change the format of the DB2 to show the sequential results as columns with each row being a unique subject and those sequential results ordered by date spread out along individual columns
    Secondly, I want to be able to combine this revised DB2 with the outcome data from DB1.

    The purpose of all of this is to compare outcomes depending on the trends in the particular test. For example, I would really like to be able to group subjects by those whose test drops by a particular percentage over time, versus those in whom the test value increases for example.

    Any pointers would be greatly appreciated!

    Do I need to use VLOOKUP to do this?

    Regards,

    Paul

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Reordering data and combining with another spreadsheet

    1. It would help to see the workbook.

    You get better help on your question if you add a small excel file, without confidential information.

    Please also add manualy the expected result in your file.

    To Attach a File:

    1. Scroll down to the window below your post Additional Options
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    05-16-2016
    Location
    Maidstone, England
    MS-Off Ver
    15.2 for Mac
    Posts
    6

    Re: Reordering data and combining with another spreadsheet

    Thanks,

    See attached. Hopefully this should make more sense.

    Of note, the numbers of results for each subject in DB2 is variable and the dates between each test may also be variable. The important thing is that the results are laid out sequentially. If the percentage change is difficult due to the variability in number of results, it should be between the first and second result

    Many thanks for the assistance!

    Paul
    Attached Files Attached Files
    Last edited by GasDoc; 05-16-2016 at 01:48 PM.

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Reordering data and combining with another spreadsheet

    Helpcolumn in the sheet data a2=B2&countif($B$2:$B2,B2)

    in sheet result: b10 =iferror(Vlookup($A10&column()-1,data!$A$2:$C$23,3,0),"") and drag accross.

    see the attached file.

  5. #5
    Registered User
    Join Date
    05-16-2016
    Location
    Maidstone, England
    MS-Off Ver
    15.2 for Mac
    Posts
    6

    Re: Reordering data and combining with another spreadsheet

    Wow - I haven't got a clue what all of this means - I'll try some "reverse engineering" to work it all out but many thanks - I'll try it on a sample of my actual data and get back to you.

    Thanks once again for your time & expertise,

    Best wishes,

    Paul

  6. #6
    Registered User
    Join Date
    05-16-2016
    Location
    Maidstone, England
    MS-Off Ver
    15.2 for Mac
    Posts
    6

    Re: Reordering data and combining with another spreadsheet

    One question, do I have to manually create the helpcolumn or is this automated - I have >3000 rows to do!

    BW

    Paul

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Reordering data and combining with another spreadsheet

    Please Login or Register  to view this content.
    we split this formula in:

    1) iferror(the formula,"") if the formula give a failure as result it will show a blanc cell.

    this formula makes that cell F10 is blanc

    2) Vlookup($A10&column()-1,data!$A$2:$C$23,3,0)

    Vlookup
    find Subject A1
    in the range on sheet 2 (which is data) in A2:C23
    in column 3 (the 3 in the formula)
    find the exact match (1 is the other option)

    3) b10=$A10&column()-1

    is subject1 and add since the formula is in column B (is value 2) and we need the result 1. we abstract het result with 1 so we get 2 -/- 1 = 1.
    the result from this aktion is SubjectA1
    I use this so we can copy the formula tot the right and below.

    Hope I explained well enough.

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Reordering data and combining with another spreadsheet

    One question, do I have to manually create the helpcolumn or is this automated - I have >3000 rows to do!
    copy the first value and paste this formula to row 2 till 3000 (so you can do this automatic).

  9. #9
    Registered User
    Join Date
    05-16-2016
    Location
    Maidstone, England
    MS-Off Ver
    15.2 for Mac
    Posts
    6

    Re: Reordering data and combining with another spreadsheet

    Sorry oeldere, I'm being slow!

    I've used the formula =B2&COUNTIF($B$2:$B2,B2) on the data worksheet (ordered by name then date) and this has created sequential numbering for each unique subject in column A

    I cannot work out how to generate the result worksheet however.

    I've cut and pasted the formula =IFERROR(VLOOKUP($A1&COLUMN()-1,data!$A$2:$C$23,3,0),"") to cell B1 but I don't understand how the formula will list all the unique subjects in column A - your example just has "subject A" followed by "subject B" - did you enter all of these manually?

    Apologies

    Paul

  10. #10
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Reordering data and combining with another spreadsheet

    I've used the formula =B2&COUNTIF($B$2:$B2,B2) on the data worksheet (ordered by name then date) and this has created sequential numbering for each unique subject in column A

    Iff you add the dates in your formula, you also have to add the date in the Vlookupformula.

    It makes the result unique.




    =IFERROR(VLOOKUP($A1&COLUMN()-1,data!$A$2:$C$23,3,0),"")

    That formula is on a other worksheet (see the example).


    Otherwise please post a small example.

  11. #11
    Registered User
    Join Date
    05-16-2016
    Location
    Maidstone, England
    MS-Off Ver
    15.2 for Mac
    Posts
    6

    Re: Reordering data and combining with another spreadsheet

    Apologies - I didn't add any dates into your formula

    Could you explain step by step how I generate the result worksheet

    Thanks

    Paul

  12. #12
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Reordering data and combining with another spreadsheet

    Otherwise please post a small example.

    show in the file where the date has to be incoperated.

+ 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. Combining seperate data into single spreadsheet
    By profitdr123 in forum Access Tables & Databases
    Replies: 1
    Last Post: 08-11-2015, 12:03 PM
  2. [SOLVED] Reordering Data
    By akboche in forum Excel General
    Replies: 5
    Last Post: 01-09-2015, 03:23 PM
  3. Replies: 5
    Last Post: 12-03-2014, 08:46 PM
  4. Combining data into 1 spreadsheet
    By apoorva_c in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2013, 06:05 AM
  5. Replies: 2
    Last Post: 08-12-2011, 10:08 AM
  6. Replies: 0
    Last Post: 03-07-2011, 07:22 AM
  7. Combining Spreadsheet data
    By Clash in forum Excel General
    Replies: 2
    Last Post: 04-08-2010, 10:19 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