+ Reply to Thread
Results 1 to 5 of 5

Extracting rows

  1. #1
    Registered User
    Join Date
    09-02-2014
    Location
    1127
    MS-Off Ver
    2013
    Posts
    3

    Extracting rows

    I have an excel sheet where the data is in the following format

    id1 abc dghajsgdjh 123
    id1 abc uidgiutgcui 245
    id2 xyz hqwhdqwq 672

    I need to extract only one row from first two rows and the third row. I need only two rows with id1 and id2.
    Can anybody help me how to get this output from a large excel sheet?

  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: Extracting rows

    Try this array formula in G2 and pull formula to the right and then down.

    =IFERROR(INDEX(B:B,SMALL(IF($A$2:$A$20=$F2,ROW($A$2:$A$20)),1)),"")

    ...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 your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    A
    B
    C
    D
    E
    F
    G
    H
    I
    2
    id1 abc dghajsgdjh
    123
    id1 abc dghajsgdjh
    123
    3
    id1 abc uidgiutgcui
    245
    id2 xyz hqwhdqwq
    672
    4
    id2 xyz hqwhdqwq
    672
    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
    Registered User
    Join Date
    09-02-2014
    Location
    1127
    MS-Off Ver
    2013
    Posts
    3

    Re: Extracting rows

    Thanks !!

    The file is too large, it has more than 5000 rows and 20 columns. I want to extract those rows and save it in another worksheet. I think that I can write a macro, but I have no idea how to write a macro.

  4. #4
    Registered User
    Join Date
    09-02-2014
    Location
    1127
    MS-Off Ver
    2013
    Posts
    3

    Re: Extracting rows

    It is not working !!

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Extracting rows

    This should work for you. Adjust the cell ranges to suit your actual data.

    In F2 enter this array formula (enter with Ctrl + Shift + Enter) and copy down.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    In G2 enter this formula and copy across and down.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

+ 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: 6
    Last Post: 08-18-2012, 05:00 AM
  2. extracting top 4 rows
    By np1966 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2012, 12:17 PM
  3. Extracting all rows/certain rows from a matrice
    By Alexander_V in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-25-2011, 11:02 AM
  4. Extracting certain rows
    By sa02000 in forum Excel General
    Replies: 4
    Last Post: 03-24-2006, 05:10 PM
  5. [SOLVED] extracting rows/columns
    By Tiffani in forum Excel General
    Replies: 3
    Last Post: 03-06-2006, 12:20 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