+ Reply to Thread
Results 1 to 7 of 7

populate table based on drop down selection

Hybrid View

dusoo populate table based on drop... 06-02-2013, 04:59 AM
alansidman Re: populate table based on... 06-02-2013, 06:54 AM
dusoo Re: populate table based on... 06-02-2013, 06:17 PM
FDibbins Re: populate table based on... 06-02-2013, 06:37 PM
dusoo Re: populate table based on... 06-02-2013, 07:05 PM
FDibbins Re: populate table based on... 06-02-2013, 07:22 PM
dusoo Re: populate table based on... 06-02-2013, 10:26 PM
  1. #1
    Registered User
    Join Date
    06-02-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    19

    populate table based on drop down selection

    Hi guys,

    I have a data table in sheet2 (in real, it's created from DB (MS query / other sources), so the line count is changing).
    I would like populate table1 @sheet1, based on selected value in the filter in sheet1

    How can I achieve this?

    excel_filter.xlsx


    Thanks

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: populate table based on drop down selection

    Create a Pivot Table as shown in attached.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    06-02-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: populate table based on drop down selection

    Quote Originally Posted by alansidman View Post
    Create a Pivot Table as shown in attached.
    Pivot table is not what I need here. I want to have all columns and related rows to be shown/copied from the source table to the new table based on the selection, not any sums and group by as in pivot.

    Thanks

  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
    53,048

    Re: populate table based on drop down selection

    Hi and welcome to the forum

    Try this. On sheet2, D2, copied down...
    =IF(A2=Sheet1!$B$1,MAX(Sheet2!$D$1:D1)+1,MAX(Sheet2!$D$1:D1))

    Then in sheet1 A14, copied down and across...
    =IFERROR(INDEX(Sheet2!$A$1:$D$12,MATCH(ROW($A1),Sheet2!$D$1:$D$12,0),MATCH(Sheet1!A$13,Sheet2!$A$1:$C$1,0)),"")

    Hoe that is what you were looking for?
    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

  5. #5
    Registered User
    Join Date
    06-02-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: populate table based on drop down selection

    this looks really good, still don't understand it fully, but have to spend bit more time on it
    However, is there a way to correct the filter in sheet1!B1? It's a dropdown list from Pivot table, which could be changing, so the list should always show new entries as well except emtpy lines and "Grand Total" value.

    Thanks

  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
    53,048

    Re: populate table based on drop down selection

    Im not sure of the need for the PT. If you must have it, use this on sheet1...
    =IFERROR(INDEX($H$3:$H$31,MATCH(0,INDEX(COUNTIF($J$2:J2,$H$3:$H$31),0,0),0)),"")

    If you can do without the PT, you can create your own list of unique customers on sheet2 with the same thing on sheet2, copied down...
    =IFERROR(INDEX($A$2:$A$30,MATCH(0,INDEX(COUNTIF($F$1:F1,$A$2:$A$30),0,0),0)),"")
    Create a named range for the list, andthen use that named range for the DV on sheet1
    you could also use this list for the count you currently use the PT for...
    =IF(F2="","",COUNTIF($A$2:$A$12,F2))

    In all instances, adjust ranges to suite

  7. #7
    Registered User
    Join Date
    06-02-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: populate table based on drop down selection

    Quote Originally Posted by FDibbins View Post
    If you can do without the PT, you can create your own list of unique customers on sheet2 with the same thing on sheet2, copied down...
    =IFERROR(INDEX($A$2:$A$30,MATCH(0,INDEX(COUNTIF($F$1:F1,$A$2:$A$30),0,0),0)),"")
    Thanks for this one, what can I do to remove 0, always added at the end of the created list?

    Attachment 240130

+ 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