+ Reply to Thread
Results 1 to 9 of 9

Drop down list to select rows - must also include "ALL"

  1. #1
    Registered User
    Join Date
    11-20-2023
    Location
    Pamplico, SC
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Drop down list to select rows - must also include "ALL"

    In my spreadsheet I have a row named "Month". I want to a drop drop list containing all of the months and, in addition, having the word "ALL". The user can either select a particular month and see every row that has that month or can choose the word "ALL" and see all of the rows. How would I do this?

    Sample Spreadsheet:

    Name Month
    John January
    Bob February
    Mary March
    Joe March

    If the user selects March, he will see the last two rows. If the user chooses "ALL", he will see all four rows.

    Thank you.
    Ed

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,982

    Re: Drop down list to select rows - must also include "ALL"

    The easiest way to do this is to select the columns, then use AutoFilter (Data > Filter). This will automatically create a dropdown for each column in the first row which will allow you pick any month, or All.

    autofilter.jpg
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    11-20-2023
    Location
    Pamplico, SC
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Re: Drop down list to select rows - must also include "ALL"

    I appreciate the reply, but I didn't state my question clearly. I've attached a spreadsheet. If you click on the drop down list in cell H1, it give you the two options "Smith" and "Jones".
    I want three options, "Smith", "Jones", and "ALL". If the user clicks on "All", then all rows of the spreadsheet will be shown.
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,998

    Re: Drop down list to select rows - must also include "ALL"

    On Sheet2 in A1:

    =VSTACK("All",UNIQUE(Scores[Teacher]))

    On Sheet1 in G4:

    =IF(H1="All",Scores,FILTER(Scores,Scores[Teacher]=H1))
    Attached Files Attached Files
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    11-20-2023
    Location
    Pamplico, SC
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Re: Drop down list to select rows - must also include "ALL"

    Thank you for the response. Is there a way to adjust this so that the drop down list is displayed alphabetically?

  6. #6
    Registered User
    Join Date
    11-20-2023
    Location
    Pamplico, SC
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Re: Drop down list to select rows - must also include "ALL"

    This spreadsheet works perfectly now (except for the alphabetized drop down list - which I can live without).
    But, if I open with Microsoft Office Profession Plus 2016, it only works correctly if I choose the "ALL" option in the drop down list.
    If I choose anything other than "ALL", I get: #NAME? for every entry in every row.
    I created this spreadsheet using Microsoft 365 for Enterprise (and it works perfectly there).

    Any ideas?

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,982

    Re: Drop down list to select rows - must also include "ALL"

    VSTACK, FILTER, and UNIQUE are available in 365 and were all implemented after 2016. I'm assuming this solution was offered based on your profile, since you did not mention you would need it to work on 2016.

    I believe a solution may still be possible but it's going to be more complex.

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,982

    Re: Drop down list to select rows - must also include "ALL"

    Here is a solution that is backwards compatible to older versions, but it requires a helper column added to the table. You can hide this column if desired. It may be possible to develop a solution that does not require the helper column.

    It uses an array formula to get the distinct teacher names in the same place that Ali put it.
    It uses a named range TeacherList for these distinct names rather than a direct cell reference. This name is used in the Data Validation list formula.
    It uses three formulas to retrieve the corresponding rows from the table, one for each column of data.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-20-2023
    Location
    Pamplico, SC
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Re: Drop down list to select rows - must also include "ALL"

    Thank you for the solution. Would you be able to explain to me exactly how you did this?

+ 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. Automatically send email select rows if cell = "Buy" or "Sell". Kindly help me.
    By kishan726 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-19-2022, 07:32 AM
  2. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  3. [SOLVED] Delete entire rows if cells include "Paper".
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2013, 07:55 AM
  4. Replies: 0
    Last Post: 08-30-2012, 04:39 PM
  5. Help Needed to get Filters Using "Include" and "Exclude" multiple values on one column.
    By alfykunable in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-23-2012, 04:03 AM
  6. Replies: 8
    Last Post: 03-07-2011, 01:43 PM
  7. macro to include "user select"
    By Silvabod in forum Excel General
    Replies: 3
    Last Post: 10-18-2005, 12:05 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