+ Reply to Thread
Results 1 to 7 of 7

command to display specific rows based on value in one column

  1. #1
    Forum Contributor
    Join Date
    08-19-2012
    Location
    Tacoma, Washingtonn
    MS-Off Ver
    Excel 2019
    Posts
    254

    command to display specific rows based on value in one column

    Greetings all: This is my project. I have a worksheet with 100 rows of data. Each row has 20 columns with the final column displaying a result. What I would like to do is create a command by which I can display and compare only rows with a defined value in column A (which would be from 0-40). Example: I would like to show only data where column A is 0-12, another where column A is 13-20, and another where column A is greater than 20. Can anyone please help? I've always had great results using this forum, thanks in advance. Jim

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: command to display specific rows based on value in one column

    You can do this by using an array formula. I have attached an example for you to look at, the middle columns will do what you want.
    Attached Files Attached Files
    Last edited by nathansav; 05-24-2013 at 12:35 PM.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,424

    Re: command to display specific rows based on value in one column

    Why can't you just use Autofilter?


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: command to display specific rows based on value in one column

    ___________________________
    Attached Files Attached Files

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,424

    Re: command to display specific rows based on value in one column

    @nathansav: nice. +1

    A couple of slight amendments:

    The formula in E2 could be:

    =IFERROR(INDEX($A$2:$A$26,SMALL(IF($B$2:$B$26=E$1,ROW($A$2:$A$26)),ROWS($B$2:$B2))-1),"") committed with Ctrl-Shift-Enter.

    Then, dragged across, only the column header reference changes.

    And the Named Ranges could be made Dynamic Named Ranges so that the Data Validation drop down lists only show non-blank entries:

    CPU_PARTS: =DATABASE!$F$2:INDEX(DATABASE!$F:$F,COUNTIF(DATABASE!$F:$F,">_"))
    MOTHERBOARD_PARTS: =DATABASE!$G$2:INDEX(DATABASE!$G:$G,COUNTIF(DATABASE!$G:$G,">_"))
    RAM_PARTS: =DATABASE!$E$2:INDEX(DATABASE!$E:$E,COUNTIF(DATABASE!$E:$E,">_"))


    Regards, TMS

  6. #6
    Forum Contributor
    Join Date
    08-19-2012
    Location
    Tacoma, Washingtonn
    MS-Off Ver
    Excel 2019
    Posts
    254

    Re: command to display specific rows based on value in one column

    I probable wasn't all that clear. I have attached a make-shift sample worksheet showing some data and what I am trying to accomplish. The displaying of results could be formatted differently (even on side-to-side worksheets) if I could figure out a way to leave out empty rows. I hope this helps... JimSample Medal Play.xlsx

  7. #7
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: command to display specific rows based on value in one column

    You would need to modify it Try dissecting what the examples do, and it will become clearer. F1 is good, as is Google.

+ 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