+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    06-26-2009
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Find & Retrieve a Set of Data

    I consolidate data for many different regions... which should not be able to see each others' sales data...

    I have a column that indicates the region and then the sales data by sales person.

    I've created a drop down box (through data validation) to allow a user to select their territory, however what is the best way for me to get the data from my list to return once a territory is selected?

    Other things to note, each territory has a different number of sales people, and certain territories have subtotals for states, which is the way I'd like the data to be shown to the user.

    I've created password restrictions with VBA to prevent users to only see the territories they have access to in the dropdown box.

    What I need, specifically, is FIND the territory that is selected, and then copy all of that info (with varying numbers of lines, but all with that territory at the start) and return it in the exact format as I have in my list.

    Is this possible?
    Attached Files Attached Files
    Last edited by kwgriffi; 06-26-2009 at 06:39 PM.

  2. #2
    Forum Guru contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2010
    Posts
    1,335

    Re: Find & Retrieve a Set of Data

    Something like this?
    Last edited by contaminated; 06-29-2009 at 06:02 PM.
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, «Born in USSR»
    Vusal M Dadashev

    Baku, Azerbaijan

  3. #3
    Registered User
    Join Date
    06-26-2009
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Find & Retrieve a Set of Data

    No, I am again not looking to subtotal the information I have, but to have a drop down return a set of data from a list, when the list contains formatting a various numbers of rows

  4. #4
    Registered User
    Join Date
    06-26-2009
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Find & Retrieve a Set of Data

    im a fool... i see now you put in the formulas

    this is very close, but it does not contain the formmating I would like to include... is this possible?

  5. #5
    Forum Guru contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2010
    Posts
    1,335

    Re: Find & Retrieve a Set of Data

    Does it take care of your needs?
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, «Born in USSR»
    Vusal M Dadashev

    Baku, Azerbaijan

  6. #6
    Forum Guru contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2010
    Posts
    1,335

    Re: Find & Retrieve a Set of Data

    Does it take care of your needs?
    Attached Files Attached Files
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, «Born in USSR»
    Vusal M Dadashev

    Baku, Azerbaijan

  7. #7
    Registered User
    Join Date
    06-26-2009
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Find & Retrieve a Set of Data

    can you help me understand how you created the array? I am having difficulty with the help to understand how to modify this to my existing data set where I have a larger sample

  8. #8
    Forum Guru contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2010
    Posts
    1,335

    Re: Find & Retrieve a Set of Data

    Shure

    First I'll divide this formula on several parts.
    Code:
    =IFERROR(INDEX(B3:B23,SMALL(IF(F2=A3:A23,ROW(INDIRECT("1:"&ROWS(3:23))),""),ROW(INDIRECT("1:"&ROWS(3:23))))),"")
    First is
    Code:
    =IF(F2=A3:A23,ROW(INDIRECT("1:"&ROWS(3:23))),"")
    This formula checks availability of the item selected in dropdown list in A3:A23. If so it'd return their row number generated with formula
    Code:
    ROW(INDIRECT("1:"&ROWS(3:23)))
    Otherwise it'd return blank.
    This trick prepares array for SMALL() function. This Array something like this
    Code:
    "","',"","","","","","","",12,13,14,15,16,17,18,19
    Each of this item separated with comma means cell. So without SMALL() function you will get your values somwhere at the bottom. SMALL() allows you to gater 'em at the top. Bur SMALL() has two arguments: RANGE and K. So for K is also
    Code:
    ROW(INDIRECT("1:"&ROWS(3:23))),"")
    'coz it'd return number like 1,2,3,4,5,6... for each cell in the array.
    And now it's a time for use INDEX() function after u have got the row number.
    So final formula is
    Code:
    =IFERROR(INDEX(B3:B23,SMALL(IF(F2=A3:A23,ROW(INDIRECT("1:"&ROWS(3:23))),""),ROW(INDIRECT("1:"&ROWS(3:23))))),"")
    included in IFERROR() in order to get rid of #NUM! error,,.
    Your issue could be done with the help of using helper columns, but this formula gathers three columns into one.
    Attached Files Attached Files
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, «Born in USSR»
    Vusal M Dadashev

    Baku, Azerbaijan

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.2.0