+ Reply to Thread
Results 1 to 11 of 11

How to show all entries that meet a certain criteria in a seperate worksheet

  1. #1
    Forum Contributor
    Join Date
    09-17-2009
    Location
    Torquay, England
    MS-Off Ver
    Excel 2013
    Posts
    253

    How to show all entries that meet a certain criteria in a seperate worksheet

    Hi,

    I have been working with personal record data in multiple workbooks, using sumif, index, vlookup etc to show various required info.

    What I now need to do is take all the records of people aged between 16-18 and list this in a new worksheet.

    I can get all the records I need in a pivot table but it needs to be something I can add columns to in order to gather further info.

    Any help would be much appreciated.
    Last edited by Gooford; 01-07-2010 at 12:58 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: How to show all entries that meet a certain criteria in a seperate worksheet

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    09-17-2009
    Location
    Torquay, England
    MS-Off Ver
    Excel 2013
    Posts
    253

    Re: How to show all entries that meet a certain criteria in a seperate worksheet

    Hi,

    I have attached an example which shows one way which I can think of showing all the info for the records who are between 16 and 18.

    However this means I will have big gaps between rows in the tables, is there a tidier way of doing this. Something like an Access query would be good, but unfortunately the original sheet (similar to BK1) has lots of gaps which I think doesnt work for data tables and queries??

    I would like the final result to show all records between 16 and 18 automatically sorted in order of age with no gaps.
    Attached Files Attached Files

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: How to show all entries that meet a certain criteria in a seperate worksheet

    See attached:

    I added in your BK2 sheet, Row 1:

    Start Date: Hard coded (allows for easy changes)
    End Date: Hard Coded (allows for easy changes)
    Total Count: =MAX('BK1'!$H:$H)

    In H2, of BK1,

    =IF(A2="","",COUNTIF(D$2:D2,">="&'BK2'!$B$1)-COUNTIF('BK1'!D$2:D2,">"&'BK2'!$D$1))

    copied down as far as you want...

    Then in A3 of Bk2:

    =IF(ROWS($A$2:$A2)>$F$1,"",INDEX('BK1'!A:A,MATCH(ROWS($A$2:$A2),'BK1'!$H:$H,0)))

    copied down and across as far as necessary...
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    09-17-2009
    Location
    Torquay, England
    MS-Off Ver
    Excel 2013
    Posts
    253

    Re: How to show all entries that meet a certain criteria in a seperate worksheet

    Thats great, I'll scratch my head a bit and then give you some feedback. Thanks very much.

  6. #6
    Forum Contributor
    Join Date
    09-17-2009
    Location
    Torquay, England
    MS-Off Ver
    Excel 2013
    Posts
    253

    Re: How to show all entries that meet a certain criteria in a seperate worksheet

    Hi,

    Just to help me understand...





    COUNTIF(D$2:D2,">="&'BK2'!$B$1)-COUNTIF('BK1'!D$2:D2,">"&'BK2'

    I think this counting the number of records in D2 (can only be 1 or 0) that are greater than or = to 16 ($B$1) and subtracting the number of records that are greater than 18 ($D$1).

    Then this number is being carried forward to the next cell as running total (which is why D$2 is fixed).



    Then A3 in BK2
    IF(ROWS($A$2:$A2)>$F$1,"",INDEX('BK1'!A:A,MATCH(ROWS($A$2:$A2),'BK1'!$H:$H,0)))

    In Bk2 Column A, if there is an entry match it with BK1 and display what is in the corresponding cell in H. Or does the use of ROWS mean sort the information into this number of rows, as long as they excede the number in column H (below)

    =MAX('BK1'!$H:$H)
    $F$1 Bk2 then looks for the largest number in columns H


    Hopefully thats vaguely near whats going on, would you mind letting me know?

    Thanks again
    Last edited by Gooford; 01-07-2010 at 12:55 PM.

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: How to show all entries that meet a certain criteria in a seperate worksheet

    Pretty much

    The max formula is used to determine how many records will be extracted... and that is used in the A3 formula... where it says IF(ROWS($A$2:$A2)>$F$1,"",...

    so that a blank is returned instead of an error when you are in a row number that is greater than the number of records to be extracted...

  8. #8
    Forum Contributor
    Join Date
    09-17-2009
    Location
    Torquay, England
    MS-Off Ver
    Excel 2013
    Posts
    253

    Re: How to show all entries that meet a certain criteria in a seperate worksheet

    dont excede that rows in Column H that should say

  9. #9
    Registered User
    Join Date
    03-03-2013
    Location
    Durham, NC
    MS-Off Ver
    MS 2010
    Posts
    5

    Re: How to show all entries that meet a certain criteria in a seperate worksheet

    basketball rosters example.xlsx

    NBVC,
    Thank you for this post. I believe this is exactly what I need, but I can't quite replicate what you did for Gooford.

    What I would like to do in the attached document is list all players from the "Players" tab in the corresponding team's roster tab. The teams need to be able to find the players regardless of their order and list all the data in the row, if possible. I feel like it is the same basic concept as Gooford's example so I thought you may be able to help.

    Thanks!

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: How to show all entries that meet a certain criteria in a seperate worksheet

    ticky7ock,

    Welcome to the Forum.

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  11. #11
    Registered User
    Join Date
    03-03-2013
    Location
    Durham, NC
    MS-Off Ver
    MS 2010
    Posts
    5

    Re: How to show all entries that meet a certain criteria in a seperate worksheet

    Thank you for your reply. I'm sorry - I will make sure I double check the rules.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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