+ Reply to Thread
Results 1 to 11 of 11

Pull data from multiple worksheets

  1. #1
    Registered User
    Join Date
    07-31-2017
    Location
    Michigan
    MS-Off Ver
    2016
    Posts
    23

    Pull data from multiple worksheets

    Ok, this is a tricky one:

    I have a workbook with multiple worksheets. In each worksheet, the rows are labeled with gene names, and the columns with case #s. The data can be one of five different values: -2, -1, 0, 1, or 2.

    Case 1 Case 2 Case 3
    Gene 1 -2 0 1
    Gene 2 -1 -1 2
    Gene 3 0 1 -1


    I need to match the Case and Gene from across the worksheets, and place them into a new sheet labeled with the above rows and column headers. However, there are duplicate Case-Gene matches across the sheets (e.g. Case 1 and Gene 1 may appear in multiple worksheets).

    I would like to pull the data with the following priorities: -2 > -1 > 0 > 1 > 2

    For example:

    If Case 1 and Gene 1 from a worksheet has the value 0, but Case 1 and Gene 1 from a different worksheet has the value -2, I would like for it to pull the value -2 (and so on, according to the priorities just listed).

    Here's an example:

    Worksheet A
    Case 1 Case 2 Case 3
    Gene 1 -2 0 1
    Gene 2 -1 -1 2
    Gene 3 0 1 -1


    Worksheet B
    Case 1 Case 2 Case 3
    Gene 1 0 1 2
    Gene 2 2 0 0
    Gene 3 -1 0 -1



    Final worksheet
    Case 1 Case 2 Case 3
    Gene 1 -2 -1 -1
    Gene 2 0 -1 0
    Gene 3 1 0 -1

  2. #2
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Pull data from multiple worksheets

    Based on the data you provided for the three sheets, I don't get the Final worksheet results. You are showing answers that are not in the other two.

    If the sheets are all identical in layout - you could use =MIN(Sheet2:Sheet3!B2)

    I hope this helps, please let me know!

    Regards,

    David

    If this has been helpful
    - Please click on the *Add Reputation button at the bottom left.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".


  3. #3
    Registered User
    Join Date
    07-31-2017
    Location
    Michigan
    MS-Off Ver
    2016
    Posts
    23

    Re: Pull data from multiple worksheets

    You are correct. Here is the correct Final worksheet I am aiming for:

    Final worksheet
    Case 1 Case 2 Case 3
    Gene 1 -2 0 1
    Gene 2 -1 -1 0
    Gene 3 -1 0 -1

    Unfortunately, the sheets are not entirely identical. Is there a way to index match the sheets to return the minimum value matching the Gene (row) and Case (column)?
    Last edited by neulite; 07-01-2018 at 01:54 PM.

  4. #4
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Pull data from multiple worksheets

    How different are they?

    Are Column and Row headings in a consistent place?

    It might be easier if there was a copy of the workbook

    Regards,

    David

    Please remember, your request is clearer if you attach a sample workbook.
    - Reply, then Click on Go Advanced and scroll down to Manage Attachments.

    If this has been helpful
    - Please click on the *Add Reputation button at the bottom left.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".


  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Pull data from multiple worksheets

    1) Sheet name A, B and Final
    2) Data should begin from A2 and heading from B1 in row1

    Please Login or Register  to view this content.
    If this doesn't work, need to see your workbook.

  6. #6
    Registered User
    Join Date
    07-31-2017
    Location
    Michigan
    MS-Off Ver
    2016
    Posts
    23

    Re: Pull data from multiple worksheets

    How do I attach an excel file to this thread?

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Pull data from multiple worksheets

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  8. #8
    Registered User
    Join Date
    07-31-2017
    Location
    Michigan
    MS-Off Ver
    2016
    Posts
    23

    Re: Pull data from multiple worksheets

    Thank you for your help. I actually need to adapt it for many sheets with large amounts of data.

    Here is a sample workbook. I need to match the cases in the columns at the top with the Gene IDs in the rows on the left, and pull them into the sheet labeled Final. I have included a sheet labeled final_before and final_after, to emulate what I would like to achieve. As you can see, there are some duplicate cases across the sheets and if it runs into a duplicate Case-Gene, then use the priority: -2 > -1 > 0 > 1 > 2. also, the gene lists aren't necessarily in the same order across the sheets.

    Many thanks!
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Pull data from multiple worksheets

    Change to
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    07-31-2017
    Location
    Michigan
    MS-Off Ver
    2016
    Posts
    23

    Re: Pull data from multiple worksheets

    Thanks for this, but I keep getting a Microsoft Visual Basic out of memory error. Any suggestions? (I am running on 16.0 GB RAM, i7, 3.40GHz)

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Pull data from multiple worksheets

    Error with the workbook you uploaded?
    Attached Files Attached Files

+ 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] Macro to pull columns of data from multiple worksheets into summary worksheets
    By crandell84 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-07-2018, 05:44 PM
  2. [SOLVED] Data Pull from Multiple Worksheets based on Criteria!!!
    By Rajeshkumar R in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-26-2017, 07:10 AM
  3. Formula to Pull Data from Multiple Worksheets
    By BrianaL in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-23-2017, 01:35 AM
  4. INDEX MATCH and INDIRECT to pull in data from multiple worksheets
    By nebshaver123 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-16-2015, 03:58 PM
  5. [SOLVED] Help with creating a macro to anaylse and pull data from multiple worksheets
    By eoghanmolloy in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-29-2012, 02:31 AM
  6. Replies: 4
    Last Post: 10-22-2012, 03:21 AM
  7. Replies: 7
    Last Post: 05-17-2012, 06:42 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