+ Reply to Thread
Results 1 to 15 of 15

Creating List from Table

  1. #1
    Registered User
    Join Date
    09-09-2008
    Location
    Troy, MI
    MS-Off Ver
    2010
    Posts
    95

    Creating List from Table

    I would like assistance with generating a list in my worksheet from an existing table that contains 18 rows and 3 columns. The table is populated with results from formulas in each cell that in this case, identify whether a golf “skin” was won. The 18 rows in the table represent one row for each of the 18 holes on the course.

    Rather than displaying the table, I want to generate a list of only the rows in the table that show results (i.e. only those holes where a skin was won). The list needs to be able to recognize the first row in the table that produces results and display the information as the initial entry in the list. I then need the list to evaluate the next row from the table that contains results and display those results as the second entry in the list. For example, if a skin was won on the first hole, then the list would display information from the table from row 1. If a skin was not won until the fifth hole, then the list would recognize that results from the first hole have already been identified and displayed and that the results from the fifth hole need to be displayed next from row 5 of the table, and so on.

    In simpler terms, I need to create a list that only displays the rows of the table where a skin has been won. It would be excellent if this list could be created so that it is dynamic in a sense regarding the number of entries in the list. For example, in week one, there were three skins won so the list would only display three rows. However, in week two, there were eight skins won so the list would need to display eight rows.
    I’ve been racking my brain on this one and I’m sure there is a simple solution, but it’s just not coming to me. Any help would be greatly appreciated!

  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,939

    Re: Creating List from Table

    Assuming your data looks something like this...

    A
    B
    3
    1
    1
    4
    2
    5
    2
    3
    6
    4
    7
    3
    8
    9
    4


    with your data in column A, use this ARRAY formula in B3, copied down...
    =IFERROR(INDEX($A$3:$A$20,SMALL(IF(A$3:A$20<>"",ROW($A$3:$A$20)-2),ROWS($A$1:A1))),"")


    ...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.
    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
    09-09-2008
    Location
    Troy, MI
    MS-Off Ver
    2010
    Posts
    95

    Re: Creating List from Table

    Thank you I will give this a try.

  4. #4
    Registered User
    Join Date
    09-09-2008
    Location
    Troy, MI
    MS-Off Ver
    2010
    Posts
    95

    Re: Creating List from Table

    Ford,
    I have been able to get the array formula you suggested to work in a test worksheet, however I have not been successful achieving results in the worksheet I’ve created to generate the list of results. I’ve taken care to create and enter the array formula per the example you provided and I’ve made certain to press CTRL+SHIFT+ENTER so that the formula functions as an array function.

    I’ve attempted to recreate the worksheet below with the actual and relevant cell addresses and content. In the event I cannot get the table below to appear correctly in the body of this reply, I have also attempted to attach a screen shot of my worksheet and attach as a *.jpg file.

    In cell Y220 of my worksheet I’ve entered the following array formula following your suggestion and have activated the array formula by pressing CTRL+SHIFT+ENTER:
    {=IFERROR(INDEX($AD$220:$AD$237,SMALL(IF(AD$220:AD$237<>"",ROW($AD$220:$AD$237)-2),ROWS($A$1:A1))),"")}

    However, the formula only produces a “blank” result. The formula does not produce an error so it appears to me that it has been written properly and is simply evaluating the data and returning a blank.

    I’ve also run the Evaluate Formula function from the Formulas ribbon. When I get to the sixth level of evaluation I see the following: IFERROR(INDEX($AD$220:$AD$237,219),””). I see that the number “219” (I am assuming this is a reference to a row number based upon results of the ROWS function as part of the above formula.
    Perhaps I’ve not entered the formula correctly. Thoughts?

    AB AC AD
    220 Hole 1
    221 Hole 2 Bates, Kevin 2.5
    222 Hole 3
    223 Hole 4
    224 Hole 5 Reed, Steve 2.5
    225 Hole 6
    226 Hole 7 Graham, David 2.5
    227 Hole 8 Reed, Steve 2.5
    228 Hole 9
    229 Hole 10 Ritacca, Mike 2.5
    230 Hole 11
    231 Hole 12
    232 Hole 13 Randle, Tom 2.0
    233 Hole 14
    234 Hole 15
    235 Hole 16 Steele, Phil 3.5
    236 Hole 17
    237 Hole 18 Gesquiere, Ron 2.5
    Attached Images Attached Images

  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,939

    Re: Creating List from Table

    Can you upload a sample workbook please?

  6. #6
    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,939

    Re: Creating List from Table

    Actually, using your sample in your post, try this...
    =IFERROR(INDEX($AC$220:$AC$239,SMALL(IF($AC$220:$AC$239<>"",ROW($A$3:$A$20)-2),ROWS($A$1:A1))),"")

    maybe you did not adjust the ranges?

  7. #7
    Registered User
    Join Date
    09-09-2008
    Location
    Troy, MI
    MS-Off Ver
    2010
    Posts
    95

    Re: Creating List from Table

    The attempt to display a table in my reply was feeble and appears inaccurate. The attached screen.jpg file represents my table and data more accurately. If you are unable to see or open that I'll be happy to send a sample spreadsheet. Thanks! P.S. I tried your recommended adjustment above to no avail. I believe the range references are off a bit?

  8. #8
    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,939

    Re: Creating List from Table

    The reason I (already) asked for a workbook is because we cant work with a pic (for testing etc)

  9. #9
    Registered User
    Join Date
    09-09-2008
    Location
    Troy, MI
    MS-Off Ver
    2010
    Posts
    95

    Re: Creating List from Table

    Please see attached. The cell highlighted in yellow ("September 20, 2014" worksheet tab, cell AL220) contains the formula. Thanks!
    Attached Files Attached Files

  10. #10
    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,939

    Re: Creating List from Table

    My mistake, sorry. Try this...
    =IFERROR(INDEX($AC$220:$AC$237,SMALL(IF($AC$220:$AC$237<>"",ROW($A$1:$A$18)),ROWS($A$1:A1))),"")
    This will give you the name.

    =IFERROR(INDEX($AD$220:$AD$237,SMALL(IF($AD$220:$AD$237<>"",ROW($A$1:$A$18)),ROWS($A$1:B1))),"")
    This will give you the score

    (Both ARRAY entered - CSE)

  11. #11
    Registered User
    Join Date
    09-09-2008
    Location
    Troy, MI
    MS-Off Ver
    2010
    Posts
    95

    Re: Creating List from Table

    Thanks. I was able to see results, however, they don't appear to be consistent with expectations. I believe I have entered the formulas properly beginning in cells AK220 for the name and AL220 for the score, but perhaps I am still making an error. I've attached a revised version of the file so you may view the results.
    Attached Files Attached Files

  12. #12
    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,939

    Re: Creating List from Table

    remove the -2 in your formula...
    =IFERROR(INDEX(AC$220:AC$237,SMALL(IF($AC$220:$AC$237<>"",ROW($A$1:$A$18)),ROWS($A$1:A1))),"")

    =IFERROR(INDEX($AC$220:$AC$237,SMALL(IF($AC$220:$AC$237<>"",ROW($A$1:$A$18)-2),ROWS($A$1:A1))),"")

    Also, I have modified the 1st range so you can just copy the whole thing across

  13. #13
    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,939

    Re: Creating List from Table

    deleted duplicate post

  14. #14
    Registered User
    Join Date
    09-09-2008
    Location
    Troy, MI
    MS-Off Ver
    2010
    Posts
    95

    Re: Creating List from Table

    Perfect that did it! I appreciate your time and help!

  15. #15
    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,939

    Re: Creating List from Table

    Happy we finally got to where you wanted to be

    If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below my 1st post to you)

+ 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: 9
    Last Post: 02-26-2014, 04:17 PM
  2. Need Help Creating a Table List
    By 4747daniellel in forum Excel General
    Replies: 6
    Last Post: 10-19-2011, 07:33 AM
  3. Need Help Creating a Table List
    By 4747daniellel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-19-2011, 03:56 AM
  4. Creating a list from a large table
    By davidmarlow in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-23-2009, 05:37 AM
  5. creating a list from a table
    By sss.seg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-17-2009, 12:52 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