+ Reply to Thread
Results 1 to 15 of 15

INDEX Array Formula with multiple criteria? possible?

  1. #1
    Registered User
    Join Date
    06-02-2010
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    96

    INDEX Array Formula with multiple criteria? possible?

    Hi all,

    I am currently using the current array formula to bring dates of meetings in from another sheet within the same workbook.

    =IF(ISERROR(INDEX(MEETINGS,SMALL(IF($BG$827=MEETINGADVISERKEY,ROW(MEETINGADVISERKEY)-MIN(ROW(MEETINGADVISERKEY))+1,""),ROW(Meetings!H1)),COLUMN(Meetings!H1))),"",INDEX(MEETINGS,SMALL(IF($BG$827=MEETINGADVISERKEY,ROW(MEETINGADVISERKEY)-MIN(ROW(MEETINGADVISERKEY))+1,""),ROW(Meetings!H1)),COLUMN(Meetings!H1)))


    It works really well matching the adviser who attended the meeting, I would like to add a limiting date range in there as well and attempted this with the following code:

    =IF(ISERROR(INDEX(MEETINGS,SMALL(IF(AND($BG$827=MEETINGADVISERKEY,MEETINGDATEKEY>=MSDATE,MEETINGDATEKEY<=MSDATE),ROW(MEETINGADVISERKEY)-MIN(ROW(MEETINGADVISERKEY))+1,""),ROW(Meetings!H1)),COLUMN(Meetings!H1))),"",INDEX(MEETINGS,SMALL(IF(AND($BG$827=MEETINGADVISERKEY,MEETINGDATEKEY>=MSDATE,MEETINGDATEKE<=MSDATE),ROW(MEETINGADVISERKEY)-MIN(ROW(MEETINGADVISERKEY))+1,""),ROW(Meetings!H1)),COLUMN(Meetings!H1)))

    using an If(and, it lets me enter the code with no error message but brings back no results, for information MS & ME DATE are formatted as a short date.

    Not sure where to go, any help would be greatly appreciated.

    Cheers

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: INDEX Array Formula with multiple criteria? possible?

    Without looking in detail...quick tip ...if you are using Excel 2007 or later you could use the IFERROR() function instead of the IF(ISERROR()). Give it a go!
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: INDEX Array Formula with multiple criteria? possible?

    Typically you can't use AND in array formulas (because AND returns a single result not an array of results). Use * to simulate AND, e.g. instead of

    =IF(AND(range1="x",range2=10,range3>5),.....

    use

    =IF((range1="x")*(range2=10)*(range3>5),.....

    or multiple IFs like

    =IF(range1="x",IF(range2=10,IF(range3>5,.....

    with that last one you need to make sure you use the correct amount of closing parentheses at the end......
    Last edited by daddylonglegs; 08-07-2012 at 07:18 AM.
    Audere est facere

  4. #4
    Registered User
    Join Date
    06-02-2010
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    96

    Re: INDEX Array Formula with multiple criteria? possible?

    thanks for the replies but I'm struggling to get either to work, not sure what i'm leaving out?

  5. #5
    Registered User
    Join Date
    06-02-2010
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    96

    Re: INDEX Array Formula with multiple criteria? possible?

    using this formula

    =IF(ISERROR(INDEX(MEETINGS,SMALL(IF(($BG$1322=MEETINGADVISERKEY)*(MEETINGDATEKEY>=MSDATE)*(MEETINGDATE<=MEDATE),ROW(MEETINGADVISERKEY)-MIN(ROW(MEETINGADVISERKEY))+1,""),ROW(Meetings!H1)),COLUMN(Meetings!H1))),"",INDEX(MEETINGS,SMALL(IF(($BG$1322=MEETINGADVISERKEY)*(MEETINGDATEKEY>=MSDATE)*(MEETINGDATE<=MEDATE),ROW(MEETINGADVISERKEY)-MIN(ROW(MEETINGADVISERKEY))+1,""),ROW(Meetings!H1)),COLUMN(Meetings!H1)))

    ---------- Post added at 10:35 PM ---------- Previous post was at 10:29 PM ----------

    =IFERROR(INDEX(MEETINGS,SMALL(IF(MEETINGADVISERKEY=$BG$1322,IF(MEETINGDATEKEY>=MSDATE,IF(MEETINGDATE<=MEDATE,ROW(MEETINGADVISERKEY)-MIN(ROW(MEETINGADVISERKEY))+1,""))),ROW(Meetings!H1)),COLUMN(Meetings!H1)),"")

    also tried this but doesn't return any results which leades me to think maybe i need to include the date formula?

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: INDEX Array Formula with multiple criteria? possible?

    That looks about right, assuming all your ranges have the same number of rows, is MEETINGS a muti-column range, I'm trying to work out why you have COLUMN(Meetings!H1) in there, are you copying the formula down and across?

  7. #7
    Registered User
    Join Date
    06-02-2010
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    96

    Re: INDEX Array Formula with multiple criteria? possible?

    still nothing with this:

    =IFERROR(INDEX(MEETINGS,SMALL(IF(MEETINGADVISERKEY=$BG$1322,IF(MEETINGDATEKEY>DATE(YEAR(MSDATE),MONTH(MSDATE),DAY(MSDATE)),IF(MEETINGDATE<DATE(YEAR(MEDATE),MONTH(MEDATE),DAY(MEDATE)),ROW(MEETINGADVISERKEY)-MIN(ROW(MEETINGADVISERKEY))+1,""))),ROW(Meetings!H1)),COLUMN(Meetings!H1)),"")

    ---------- Post added at 10:39 PM ---------- Previous post was at 10:38 PM ----------

    yeh meetings is a multicolumn range, i use this formula to build statements that show the meetings held for the month, ie in the adjacent row i use:

    =IF(ISERROR(INDEX(MEETINGS,SMALL(IF($BG$1322=MEETINGADVISERKEY,ROW(MEETINGADVISERKEY)-MIN(ROW(MEETINGADVISERKEY))+1,""),ROW(Meetings!C1)),COLUMN(Meetings!C1))),"",INDEX(MEETINGS,SMALL(IF($BG$1322=MEETINGADVISERKEY,ROW(MEETINGADVISERKEY)-MIN(ROW(MEETINGADVISERKEY))+1,""),ROW(Meetings!C1)),COLUMN(Meetings!C1)))

    which brings through the clients name from the meeting.

    ---------- Post added at 10:40 PM ---------- Previous post was at 10:39 PM ----------

    and drag down

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: INDEX Array Formula with multiple criteria? possible?

    Can you post the sheet or a representative example?

  9. #9
    Registered User
    Join Date
    06-02-2010
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    96

    Re: INDEX Array Formula with multiple criteria? possible?

    appreciate the help I have attached a stripped out version effectively shows the same data just with all sensitive stuff and code taken out.

    Cheers
    Attached Files Attached Files

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: INDEX Array Formula with multiple criteria? possible?

    MSDATE and MEDATE are not defined in your attached workbook... where are those dates?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  11. #11
    Registered User
    Join Date
    06-02-2010
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    96

    Re: INDEX Array Formula with multiple criteria? possible?

    apologies forgot them please see attached.

    Cheers
    Attached Files Attached Files

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: INDEX Array Formula with multiple criteria? possible?

    Does this work, in Notes column starting at Q23:

    Please Login or Register  to view this content.
    CSE confirmed and copied down... (note: you need to remove merged cells first).

  13. #13
    Registered User
    Join Date
    06-02-2010
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    96

    Re: INDEX Array Formula with multiple criteria? possible?

    amazing, thank you very much

  14. #14
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: INDEX Array Formula with multiple criteria? possible?

    Please remember to mark your thread as SOLVED

  15. #15
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: INDEX Array Formula with multiple criteria? possible?

    @ a.mack123

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

+ 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