+ Reply to Thread
Results 1 to 7 of 7

Creating Lists based on values in a table.

  1. #1
    Registered User
    Join Date
    01-14-2014
    Location
    Somewhere, Canada
    MS-Off Ver
    Excel 2010
    Posts
    11

    Creating Lists based on values in a table.

    Hi,

    I am trying to create an array formula that would list all the corresponding rows that contain a certain value.

    Here is an example workbook to help illustrate what I'm trying to accomplish:

    Book1.xlsx

    I need to create a list/table that would show all the row labels that correspond to a value. For example, I need to make a list of all cells with a value of 1 under the "Green" column and list the row label(s) that correspond to 1.

    Creating the list would result in following return values for "Green": A,C,E,F in separate rows.

    I've been using http://www.get-digital-help.com/2009...okup-in-excel/ as a guide but the formulas did not return a corresponding row label. Pivot tables did not help me accomplish this either.

    Could anyone suggest a way to start off creating this formula? Is it possible to do without using an array formula?

  2. #2
    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,929

    Re: Creating Lists based on values in a table.

    I have a feelingthis is way too simplistic for what you want, but if so, maybe you/we can build on it. I added a helper column (I used H, you can hide this if you want)...

    A
    B
    C
    D
    E
    F
    G
    H
    1
    Red Orange Yellow Green Blue Violet
    2
    A
    1
    1
    0.5
    1
    0.5
    2
    1
    3
    B
    1
    0.5
    1
    2
    1
    1
    1
    4
    C
    0.5
    1
    2
    1
    0.5
    1
    2
    5
    D
    2
    0
    1
    0.5
    1
    1
    2
    6
    E
    1
    1
    0.5
    1
    2
    0.1
    3
    7
    F
    0.5
    1
    2
    1
    1
    2
    4
    8
    9
    10
    11
    A
    12
    C
    13
    E
    14
    F


    H2=IF(E2=1,H1+1,H1) copied down
    A11=IFERROR(INDEX($A$2:$A$7,MATCH(ROW(A1),$H$2:$H$7,0)),"") copied down
    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

  3. #3
    Registered User
    Join Date
    01-14-2014
    Location
    Somewhere, Canada
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Creating Lists based on values in a table.

    This is exactly the result that I'm looking for! What I was trying to do, was to get the result of this without using a separate column (H).

    I've gotten a result with:

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


    I'm just going to find a way to do this for "Red", "Orange", etc. now.

  4. #4
    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,929

    Re: Creating Lists based on values in a table.

    OK this ARRAY will work for "GREEN"...
    =INDEX($A$2:$A$7,SMALL(IF($E$2:$E$7=1,ROW($A$2:$A$7)-ROW($A$2)+1),ROW($A1)))
    I will put an offset together for you so you can pick the column you want

  5. #5
    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,929

    Re: Creating Lists based on values in a table.

    Try this ARRAY formula.

    Enter the color in B10, then use this, copied down...
    =INDEX($A$2:$A$7,SMALL(IF(OFFSET($A$2,0,MATCH($B$10,$A$1:$G$1,0-1)-1,COUNTA($A$2:$A$8),1)=1,ROW($A$2:$A$7)-ROW($A$2)+1),ROW($A1)))

  6. #6
    Registered User
    Join Date
    01-14-2014
    Location
    Somewhere, Canada
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Creating Lists based on values in a table.

    Quote Originally Posted by FDibbins View Post
    Try this ARRAY formula.

    Enter the color in B10, then use this, copied down...
    =INDEX($A$2:$A$7,SMALL(IF(OFFSET($A$2,0,MATCH($B$10,$A$1:$G$1,0-1)-1,COUNTA($A$2:$A$8),1)=1,ROW($A$2:$A$7)-ROW($A$2)+1),ROW($A1)))
    Thanks for this! I got it to work with this formula!

  7. #7
    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,929

    Re: Creating Lists based on values in a table.

    Happy to help and thanks for the feedback

+ 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. Creating a Total values in a table based on cheque numbers
    By highlystrung in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-18-2013, 09:55 AM
  2. Creating a List from a Table, based on Cell Values
    By Dan86 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-28-2013, 06:01 PM
  3. Replies: 3
    Last Post: 09-02-2010, 03:04 AM
  4. [SOLVED] Creating Lists Based on Other Lists
    By amyxkatexx in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-12-2010, 01:50 PM
  5. Creating lists based on category
    By NearClueless in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-10-2009, 04:02 PM

Tags for this Thread

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