+ Reply to Thread
Results 1 to 6 of 6

Return non-blank cells based on drop-down

  1. #1
    Registered User
    Join Date
    09-13-2013
    Location
    Kansas
    MS-Off Ver
    Excel 2010
    Posts
    3

    Return non-blank cells based on drop-down

    I've spent way too much time trying to figure this out on my own and have now swallowed my pride...This is my first post to excelforum, so I apologize if I've done something incorrectly.

    I've created a "dummy" spreadsheet to mimic what I'm trying to accomplish.

    High-level, I'm trying to bring in non-blank cells for a given product selected from a drop-down

    Cell B3: would like to be able to have a dropdown menu (cells B2:possibly up to KO2) based on the "Category" selected in B2. (If this is not possible, I can have a separate "Ingredients Output" tab for each type of "Category"--it's just not optimal)

    And then in cells A7:B??, show the ingredients and quantity needed for the selected "Recipe" in B3.

    I'm really hoping to not have to use a macro.

    Using Excel 2010

    Thanks in advance for your help! I'm extremely grateful for people like you who are far smarter than I ever hope to become!

    Jared
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Return non-blank cells based on drop-down

    These are ARRAY formulas in columns D and E. Any edits to those formula (shouldn't be necessary unless you have more than 100 ingredients) will require you confirm the changes 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.


    The Data Validation drop down list in B2 is dynamic, it will expand itself to include all the items on row 2 of whichever sheet you select in A2.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Return non-blank cells based on drop-down

    Or

    In B3 Cell Data Validation List
    Formula: copy to clipboard
    Please Login or Register  to view this content.


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


    In B7 Cell

    =IFERROR(INDEX(INDIRECT("'"&$B$2&"'!B3:"&ADDRESS(100,COLUMNS($2:$2))),ROW(A1),MATCH($B$3,INDIRECT("'"&$B$2&"'!B2:"&ADDRESS(2,COUNTA(INDIRECT("'"&$B$2&"'!B2:B"&COLUMNS($2:$2))))),0)),"")

    Drag both the formula's down...


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Registered User
    Join Date
    09-13-2013
    Location
    Kansas
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Return non-blank cells based on drop-down

    Thank you, JBeaucaire & Sixthsense.

    JBeaucaire--the sheet works exactly like I was looking for (only showing the ingredients being used and not all of them), but I can't seem to make it work on my workbook. For the ingredient piece, I have the following code:

    The "ingredient" equivalent for my actual work file is between cells C13:C22. The different "recipes" are in row 5 starting in column J. (They are a concatenation--does that make a difference?).

    The code I am using is:

    {=IFERROR(INDEX(INDIRECT("'" & $B$1 & "'!c13:c22"), SMALL(IF(OFFSET(INDIRECT("'" & Sheet1!$B$1 & "'!c13:c22"),,MATCH($B2, INDIRECT("'" & Sheet1!$B$1 & "'!5:5"),0)-1,,)<>"",ROW($B$3:$B$100)-2),ROWS($A$2:$A2))),"")}

    I'm guessing it has something to do with the -1 and -2, but I've tried other numbers and still can't get it to work...

    Any thoughts or anything that sticks out being incorrect?

    Thank!

    Jared

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Return non-blank cells based on drop-down

    You have a file for me to look at so I can check your work?

  6. #6
    Registered User
    Join Date
    09-13-2013
    Location
    Kansas
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Return non-blank cells based on drop-down

    Thanks for your help. Find attached.
    Attached Files Attached Files

+ 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. [SOLVED] Return variable value based on drop-down
    By Mr. Newbtastic in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-08-2013, 04:44 PM
  2. Return Blank Cell if Sum Cells Blank or Zero
    By Battledeck in forum Excel General
    Replies: 6
    Last Post: 06-11-2012, 05:55 PM
  3. Trying to return Linked Cells blank when blank.
    By RAMOORE in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-08-2011, 02:55 PM
  4. print only formulated cells that return numbers rather than cells that return blank
    By jaganath in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2010, 03:46 PM
  5. Replies: 3
    Last Post: 11-22-2007, 07:53 AM

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