Consulting

Results 1 to 5 of 5

Thread: Get sub group data based on main group

  1. #1

    Get sub group data based on main group

    The attached file contains two sheets.
    First sheet is the Main sheet which contains the Main Group and Sub group data.
    Second sheet is the "Report" sheet where cell B! contains a drop downlist.

    Now I want to show the name of the members based on cell B1 value starting from cell B3. for eg., if I select "Marketing" in cell B1 then all the members name for "Marketing" should display in cell B3,B4 and so on. I will put the formula till row 50 as at most 50 records could be there.

    Help needed to draw the formula for the same. (No macro)

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    Would placing an autofilter on the first column of the Main sheet not do this for you, as in the attached?
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    Hi,
    Thanks for the reply.
    But this is a part of my small project where the final output sheet ie Report will be sent to higher authority and also data are complex in actual. This is simplified version to know the formula.
    So autofilter wouldnot work.

  4. #4
    VBAX Regular Danny's Avatar
    Joined
    Mar 2009
    Posts
    49
    Location
    Here is the same workbook with a macro that will run automatically every time the dept choice changes. I don't know how to do it with just formulas... Hope this helps.
    I not only use all the brains that I have, but all that I can borrow.

  5. #5
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    Here's a spreadsheet solution.
    In Report! B3:B11, put the array formula
    =INDEX(Main!$B:$B,SMALL(IF(Main!$A2:$A12=B1,ROW(Main!$A2:$A12),999),ROW($A1 :$A120)))&""

    If you have a dynamic named range
    Name: Departments
    RefersTo: =OFFSET(Main!$A$2,0,0,COUNTA(Main!$A:$A)-1,1)

    This array formula in D3 : D11 will react to the entry in D1

    =INDEX(Main!B:B,SMALL(IF(Departments=D1,ROW(Departments),999),ROW($A1:$A120 )),1)&""

    Both these formulas need to be confirmed with Ctrl-Shift-Enter (Cmd+Return for Mac)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •