+ Reply to Thread
Results 1 to 19 of 19

Can a dropdown selection format specific cells in a list?

  1. #1
    Registered User
    Join Date
    09-21-2016
    Location
    Los Angeles
    MS-Off Ver
    2013
    Posts
    15

    Can a dropdown selection format specific cells in a list?

    Hoping this be done without going to VBA, but open to suggestions...

    Suppose I have a list of 5 vegetables and depending on who I am shopping for, I need to buy a different subset of those vegetables. Is it possible to put the names in a dropdown selector, and have the list of fruits called-out for that name? While also leaving the non-desired items un-highlighted? Example table below and screenshot of what i want to have happen. Is this possible? Are there other non-VBA options i'm not considering (e.g. checkboxes get auto-checked?). Thanks for any ideas!

    NAME APPLE ORANGE BANANA PEAR GRAPES
    Paul X X X
    John X X
    Ringo X X X

    Capture.PNG

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Can a dropdown selection format specific cells in a list?

    Try this...

    Data Range
    A
    B
    C
    D
    E
    F
    1
    NAME
    APPLE
    ORANGE
    BANANA
    PEAR
    GRAPES
    2
    Paul
    X
    X
    X
    3
    John
    X
    X
    4
    Ringo
    X
    X
    X
    5
    6
    7
    Ringo
    ORANGE
    8
    PEAR
    9
    GRAPES
    10


    This array formula** entered in B7:

    =IFERROR(INDEX($1:$1,SMALL(IF(A$2:A$4=A$7,IF(B$2:F$4="X",COLUMN(B$2:F$4))),ROWS(B$7:B7))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down until you get blanks.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    09-21-2016
    Location
    Los Angeles
    MS-Off Ver
    2013
    Posts
    15

    Re: Can a dropdown selection format specific cells in a list?

    Thanks Tony. This appears to definitely work for half my problem - but is there a way to have the array also show the items that are not listed (formatted differently)? I'm looking to have all Fruits in the list, but then only format the desired ones based on the name selected.

  4. #4
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Can a dropdown selection format specific cells in a list?

    1 validation list, 5 coditional formatting


    Kind regards
    Leo
    Attached Files Attached Files

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Can a dropdown selection format specific cells in a list?

    Like this...

    Data Range
    A
    B
    C
    D
    E
    F
    1
    NAME
    APPLE
    ORANGE
    BANANA
    PEAR
    GRAPES
    2
    Paul
    X
    X
    X
    3
    John
    X
    X
    4
    Ringo
    X
    X
    X
    5
    6
    7
    Ringo
    APPLE
    8
    ORANGE
    9
    BANANA
    10
    PEAR
    11
    GRAPES


    Select the range B7:B11

    Goto the Home tab>Styles>Conditional Formatting>
    Manage rules>New rule>Use a formula to determine
    which cells to format

    Enter this formula in the box below:

    =COUNTIFS(B$1:F$1,B7,INDEX(B$2:F$4,MATCH(A$7,A$2:A$4,0),0),"X")

    Click the Format button
    Select the desired style(s)
    OK out

  6. #6
    Registered User
    Join Date
    09-21-2016
    Location
    Los Angeles
    MS-Off Ver
    2013
    Posts
    15

    Re: Can a dropdown selection format specific cells in a list?

    @Tony, i can't seem to get that to work. it still only shows the populate values in the array list.

    @Leo, i think i have reverse engineered your solution to see how it was done - really nice! But i'm having issues converting it to my purpose. It turns out the example I gave has the columns and rows switched, so i updated my example below to reflect this. How can you get the conditional formatting formula of =LEN(INDIRECT("B"&MATCH($H$1,$A:$A,0)))=0 to now find the right cell to look for the 0 value?

    FRUIT Paul John Ringo
    Apple X X
    ORANGE X X X
    BANANA X
    PEAR X
    GRAPES X

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Can a dropdown selection format specific cells in a list?

    Quote Originally Posted by neim0003 View Post
    @Tony, i can't seem to get that to work. it still only shows the populate values in the array list.
    Instead of using the formula to generate only those items that have the "X" I assumed you have ALL the items manually entered.

    I think it's about time you post a small sample file and show us what results you expect.

  8. #8
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Can a dropdown selection format specific cells in a list?

    See second sheet (blad2)

    beside the validation list and the conditional formating
    there is also an named range ( for the names )


    Cheers
    Leo
    Attached Files Attached Files

  9. #9
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,367

    Re: Can a dropdown selection format specific cells in a list?

    Using conditional formatting, Iam using Leo Taxi file's
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Can a dropdown selection format specific cells in a list?

    @ azumi

    cost you 1 beer

  11. #11
    Registered User
    Join Date
    09-21-2016
    Location
    Los Angeles
    MS-Off Ver
    2013
    Posts
    15

    Re: Can a dropdown selection format specific cells in a list?

    Thanks Tony, i understand now. Your solution looks to be pretty simply now that i see it's removed the array component. To help, here is a the sample file i am trying to create. I want A2:A15 to format based on what is selected in A1. In columns C, D, and E you can see what my desired result is. I also included a grid for indexing in columns G through J. Thanks again for the help, definitely appreciate it! I was not familiar with conditional formatting via formulas, so this looks to be a good win.
    Attached Files Attached Files

  12. #12
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,367

    Re: Can a dropdown selection format specific cells in a list?

    Hope this works
    Attached Files Attached Files

  13. #13
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Can a dropdown selection format specific cells in a list?

    Same result,

    formula in conditional formatting shorter



    Kind regards
    Leo
    Attached Files Attached Files

  14. #14
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Can a dropdown selection format specific cells in a list?

    Quote Originally Posted by neim0003 View Post
    I want A2:A15 to format based on what is selected in A1.
    Try this...

    Select the range A2:A15
    Conditional Formatting
    Formula:

    =OFFSET(H$1,ROWS(A$2:A2),MATCH(A$1,H$1:J$1,0)-1)="X"

    Apply your desired style(s)
    OK out

  15. #15
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Can a dropdown selection format specific cells in a list?

    Quote Originally Posted by LeoTaxi View Post
    Same result,

    formula in conditional formatting shorter
    https://www.excelforum.com/showthread.php?t=1040120



    ---------------------

  16. #16
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Can a dropdown selection format specific cells in a list?

    Quote Originally Posted by azumi View Post
    Hope this works
    https://www.excelforum.com/showthread.php?t=1040120



    ---------------------

  17. #17
    Registered User
    Join Date
    09-21-2016
    Location
    Los Angeles
    MS-Off Ver
    2013
    Posts
    15

    Re: Can a dropdown selection format specific cells in a list?

    Thank you all, these examples are perfect and I have what I need. Conditional Formatting formulas ... a basic idea, but one I never realized the power of.

  18. #18
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Can a dropdown selection format specific cells in a list?

    You're welcome. Thanks for the feedback!

  19. #19
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Can a dropdown selection format specific cells in a list?

    Formula from #13

    =LEN(INDEX($G:$I,ROW(),MATCH(A$1,$G$1:$I$1,0)))>0


    Cheers
    Leo

+ 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. How to allow selection of data in dropdown list if & only if other cells are filled
    By exceljk88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-12-2016, 12:55 AM
  2. Replies: 0
    Last Post: 08-08-2014, 12:12 PM
  3. [SOLVED] Auto populate adjacent cells based on specific dropdown selection
    By ahtigers10 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-02-2014, 08:11 PM
  4. [SOLVED] Remove pattern from cells only if another cell has a specific selection from dropdown list
    By mook25 in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 08-16-2013, 07:32 AM
  5. Show specific rows and colums on dropdown list selection
    By info5 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-07-2012, 02:22 AM
  6. [SOLVED] Want to populate a group of cells when a particular selection is made from a dropdown list
    By ChezHenri in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-30-2012, 01:08 PM
  7. Replies: 3
    Last Post: 02-24-2011, 01:48 AM

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