+ Reply to Thread
Results 1 to 13 of 13

Can Index or Match return multiple results?

Hybrid View

  1. #1
    Registered User
    Join Date
    11-27-2006
    Posts
    11

    Can Index or Match return multiple results?

    I've spent the last week trying to do the following, with little to no success....and I'm running out of hair to pull out!!

    I have a worksheet (let's call it DATA) with the following column headers:
    * Site Name
    * Year Initiated
    * Status

    plus a whole bunch of other columns of information.

    On a separate worksheet (let's call it RESULTS) I'm trying to create a summary of all the Site Names where the Year Initiated = "2004" and the Status = "Active". There will be multiple occurences where this is true.

    I then want to create further results where the year = 2005, 2006, etc., etc. I've been trying to use the INDEX function with variations of MATCH, SMALL, ROW, etc., etc., but so far, no luck.

    Can anyone help? Please??

    Thanks in advance!

    Note, Advanced Filtering is not an option as I need to do further manipulating of the results on the RESULTS worksheet.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Does this example help

    VBA Noob
    Attached Files Attached Files
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    11-27-2006
    Posts
    11
    VBA, this looks great! I'm heading to a conference for the next 2 days but will look at this more closely and see if I can replicate the function with the live dataset. I haven't used ISERROR before so need some time to understand how it works.

    Thanks for taking the time and effort to put together the example and functions! Much appreciated!!

  4. #4
    Registered User
    Join Date
    11-27-2006
    Posts
    11
    Quote Originally Posted by VBA Noob
    Hi,

    Does this example help

    VBA Noob
    Hi VBA Noob,

    I've been trying to implement your solution into my spreadsheet, but only with limited success (the overarching IF statement returns the 'value_if_true').

    Can you look at the attached and see if you can easily find the problem? I'm trying to display the results where the year and status are '2005 / 06' and 'PS'.

    Thanks!
    Attached Files Attached Files

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Try this in E2 and mod for othe condtions

    =IF(ISERROR(INDEX(AllSites!$B$1:$B$43,SMALL(IF((AllSites!$C$1:$C$43=Results!$J$2)*(AllSites!$G$1:$G$43=Results!$K$2),ROW($1:$43)),ROW(1:1)),COLUMNS($A:A))),"",(INDEX(AllSites!$B$1:$B$43,SMALL(IF((AllSites!$C$1:$C$43=Results!$J$2)*(AllSites!$G$1:$G$43=Results!$K$2),ROW($1:$43)),ROW(1:1)),COLUMNS($A:A))))

    VBA Noob

  6. #6
    Registered User
    Join Date
    11-27-2006
    Posts
    11
    Hi VBA,

    It's working better, but not pulling the correct data out. Instead it appears to be grabbing every second site name and then starts to ignore the requirement for the site status to equal "PS". Note if I'm taking too much of your time, feel free not to respond and I'll continue trying to figure it out. I've attached the updated spreadsheet with your revisions and the results. See attached.

    I also better understand your first ROW function, but the second one and the COLUMNS function are still confusing for me.
    Attached Files Attached Files

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    =IF(ISERROR(INDEX(AllSites!$B$1:$B$43,SMALL(IF((AllSites!$C$1:$C$43=Results!$J$2)*(AllSites!$G$1:$G$43=Results!$K$2),ROW($1:$43)),ROW(1:1)),COLUMNS($A:A))),"",(INDEX(AllSites!$B$1:$B$43,SMALL(IF((AllSites!$C$1:$C$43=Results!$J$2)*(AllSites!$G$1:$G$43=Results!$K$2),ROW($1:$43)),ROW(1:1)),COLUMNS($A:A))))

    VBA Noob

+ Reply to Thread

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.6.0 RC 1