+ Reply to Thread
Results 1 to 8 of 8

Probably an easy thing to do - filter and extract data from columns to another sheet

  1. #1
    Forum Contributor
    Join Date
    11-26-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    116

    Probably an easy thing to do - filter and extract data from columns to another sheet

    Hi all, I hope you're doing great this fine day.


    I'm trying to do the following thing but don't really know where to start:

    So here is what my sheet looks like:

    (A)(B)(C)
    X | 1 | 4
    Y | 2 | 6
    X | 2 | 1
    Y | 5 | 6
    Y | 7 | 8
    X | 4 | 2

    I would like to "sort" that data and create this kind of table:

    for X
    1 | 4
    2 | 1
    4 | 2

    for Y
    2 | 6
    5 | 6
    7 | 8

    So it seems I have to play with filters (from what I've seen) but I don't want to have a range of data selected because I want to be able to add data in my first table and have it automatically copied in the corresponding sorted table.
    So I don't really want to filter my table but create another one with the information I need. And I can "only copy filtered data to the active sheet" when I try to use the filter thingy.
    I also looked up (pun incoming) stuff about the vlookup (yeey!) function but it doesn't seem to be what I'm looking for.

    Any tip - link - stuff - cake you can give me?

    Thanks in advance!

    Simon
    Last edited by dourpil; 11-26-2013 at 04:05 PM.

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Probably an easy thing to do - filter and extract data from columns to another sheet

    Try these array (Ctrl+Shft+Enter} formuals

    In D2 and drag it to the right one field and down

    For X

    =IFERROR(INDIRECT(CHAR(65+COLUMN(A2))&SMALL(IF($A$2:$A$7="X",ROW($A$2:$A$7),""),ROWS($A$2:A2))),"")

    For Y

    In G2 and drag it to the right one field and down

    =IFERROR(INDIRECT(CHAR(65+COLUMN(A2))&SMALL(IF($A$2:$A$7="Y",ROW($A$2:$A$7),""),ROWS($A$2:A2))),"")

    A
    B
    C
    D
    E
    F
    G
    H
    1
    X
    Y
    2
    X
    1
    4
    1
    4
    2
    6
    3
    Y
    2
    6
    2
    1
    5
    6
    4
    X
    2
    1
    4
    2
    7
    8
    5
    Y
    5
    6
    6
    Y
    7
    8
    7
    X
    4
    2
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Probably an easy thing to do - filter and extract data from columns to another sheet

    here is another option (prefer AlKey's suggestion though)...
    Attached Files Attached Files
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Contributor
    Join Date
    11-26-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: Probably an easy thing to do - filter and extract data from columns to another sheet

    Quote Originally Posted by AlKey View Post
    Try these array (Ctrl+Shft+Enter} formuals

    In D2 and drag it to the right one field and down

    For X

    =IFERROR(INDIRECT(CHAR(65+COLUMN(A2))&SMALL(IF($A$2:$A$7="X",ROW($A$2:$A$7),""),ROWS($A$2:A2))),"")

    For Y

    In G2 and drag it to the right one field and down

    =IFERROR(INDIRECT(CHAR(65+COLUMN(A2))&SMALL(IF($A$2:$A$7="Y",ROW($A$2:$A$7),""),ROWS($A$2:A2))),"")

    A
    B
    C
    D
    E
    F
    G
    H
    1
    X
    Y
    2
    X
    1
    4
    1
    4
    2
    6
    3
    Y
    2
    6
    2
    1
    5
    6
    4
    X
    2
    1
    4
    2
    7
    8
    5
    Y
    5
    6
    6
    Y
    7
    8
    7
    X
    4
    2

    Hello and thank you for the quick reply! It works fine when I try it on a blank sheet but I want to adapt an existing sheet.
    In the table I'm trying to sort, they're not X and Y but numbers that I want to extract. My guess is that I need to adapt the CHAR(65 + ...) in your formulas (as well as the "="X""). Would you mind explaining these to me so I can adapt them?

    Thanks again!

  5. #5
    Forum Contributor
    Join Date
    11-26-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: Probably an easy thing to do - filter and extract data from columns to another sheet

    Quote Originally Posted by FDibbins View Post
    here is another option (prefer AlKey's suggestion though)...
    Hi and thank you also for your quick reply

    I'm having an issue with that option too: In my sheet there is a column between columns A and B of your sheet so your formula
    =IFERROR(INDEX(C$2:C$7;MATCH(ROWS($A$1:B1);D$2:D$7;0));"")
    located in H2 isn't doing the trick for me.

    I tried to replace the "ROWS($A$1:B1)" by something like "ROWS($A$1;C1)" (to ignore the B column) but that, as you probably figured, doesn't work. Is there an elegant way of changing the formula? Else I could just copy my data so that I have nothing between the two

    Thanks again!

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Probably an easy thing to do - filter and extract data from columns to another sheet

    Unfortunately, you never provided us with the correct ranges in your requirements. So, the examples that were given to you simply reflect an idea of how this should work. I hope you would agree that we simply can't read someones mind.

  7. #7
    Forum Contributor
    Join Date
    11-26-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: Probably an easy thing to do - filter and extract data from columns to another sheet

    Quote Originally Posted by AlKey View Post
    Unfortunately, you never provided us with the correct ranges in your requirements. So, the examples that were given to you simply reflect an idea of how this should work. I hope you would agree that we simply can't read someones mind.
    I totally agree with you. I "simplified" the example because I didn't want to just upload my sheet and let you guys do all the work. I thought that was a more appreciated way of asking for help in forums. I guess I was too vague, sorry about that.

    In the end your solution is working for me. I simply used a "transition table" where I pre-sorted my data to make your formulas work. My apologies again if I made you feel like you wasted time, that was not my point at all!

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Probably an easy thing to do - filter and extract data from columns to another sheet

    Glad that you were able to make it work. Don't forget to thank those who helped by clicking on Add Reputation * and please mark thread as "Solved" if your issue has been resolved. (Selecting Thread Tools-> Mark thread as Solved).

+ 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] Advanced Filter - extract data to new sheet
    By schnautza in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-28-2014, 02:43 PM
  2. Multiple Pivot tables filter same data change template of all easy?
    By ThomasCarter in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-10-2013, 11:49 AM
  3. Extract data from different columns in an excel sheet and merge them as a string.
    By zrsansari in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-31-2012, 12:55 AM
  4. [SOLVED] comparing two sheets columns extract data into new sheet
    By dalerdd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2012, 11:43 AM
  5. Replies: 1
    Last Post: 10-07-2005, 04:05 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