+ Reply to Thread
Results 1 to 11 of 11

IFERROR Function based on multiple criteria

  1. #1
    Registered User
    Join Date
    11-08-2019
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    10

    IFERROR Function based on multiple criteria

    Hi there - I've got a workbook that's collecting data from one sheet and creating a list based on two sets of criteria in another. I am using the following formula which is working fine but I need to add an additional test to this formula along the lines of 'Table 1'!$A$9:$A:1509="Leeds"

    =IFERROR(INDEX('Table 1'!$G$9:$G$1509,SMALL(IF('Table 1'!$B$9:$B$1509="Awarded",ROW($G$9:$G$1509)-ROW($G$9)+1),ROWS($G$9:$G9))),"")

    Currently it's populating everything under "Awarded" so I need to insert a second condition so that anything that is not listed against "Leeds" is not included as I will be creating further tables for other locations elsewhere in the workbook.

    Note - I am using ctrl+shift+enter to close this. Like I said, all working fine so far just unable to add second test.

    I can't upload unfortunately as work with sensitive data - sorry, I know that's not very helpful.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: IFERROR Function based on multiple criteria

    Hi & welcome to the board.
    How about
    =IFERROR(INDEX('Table 1'!$G$9:$G$1509,aggregate(15,6,(row('Table 1'!$G$9:$G$1509)-row('Table 1'!$G$9)+1)/(('Table 1'!$B$9:$B$1509="Awarded")&( 'Table 1'!$A$9:$A:1509="Leeds" ),rows($G$9:$G9)))

    This is a normal formula, no need for CSE

  3. #3
    Registered User
    Join Date
    11-08-2019
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    10

    Re: IFERROR Function based on multiple criteria

    Hi there - thanks for responding! Unfortunately it's returning an error... I added a $ to the last row part of the Leeds condition in case it was that but it's still not working. May I ask what the 15,6 after aggregate is for? I'm a novice when it comes to this so like to keep notes on all the help I get in case it comes in handy for other bits of work...

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,022

    Re: IFERROR Function based on multiple criteria

    There's a typo in the previous formula:

    =IFERROR(INDEX('Table 1'!$G$9:$G$1509,aggregate(15,6,(row('Table 1'!$G$9:$G$1509)-row('Table 1'!$G$9)+1)/(('Table 1'!$B$9:$B$1509="Awarded")*( 'Table 1'!$A$9:$A:1509="Leeds" ),rows($G$9:$G9)))
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Registered User
    Join Date
    11-08-2019
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    10

    Re: IFERROR Function based on multiple criteria

    Hi Glenn - thanks for assisting. It's still returning an error - not sure if this helps but the error box is as follows:

    AGGREGATE(function_num,options, array ,[k]
    AGGREGATE(function_num,options,array, ref1

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,022

    Re: IFERROR Function based on multiple criteria

    Just spotted another typo

    =IFERROR(INDEX('Table 1'!$G$9:$G$1509,aggregate(15,6,(row('Table 1'!$G$9:$G$1509)-row('Table 1'!$G$9)+1)/(('Table 1'!$B$9:$B$1509="Awarded")*( 'Table 1'!$A$9:$A:1509="Leeds" )),rows($G$9:$G9)))

    If that doesn't fix it, read the yellow banner at the top of the screen and attach an excel sheet with the problem.

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: IFERROR Function based on multiple criteria

    Didn't do a very good job with that
    with all corrections, it should be
    =IFERROR(INDEX('Table 1'!$G$9:$G$1509,aggregate(15,6,(row('Table 1'!$G$9:$G$1509)-row('Table 1'!$G$9)+1)/(('Table 1'!$B$9:$B$1509="Awarded")*('Table 1'!$A$9:$A$1509="Leeds")),rows($G$9:$G9)))

    The 15 signifies SMALL and the 6 instructs it to ignore errors.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,022

    Re: IFERROR Function based on multiple criteria

    No. I just kept finding more errors!!

    =IFERROR(INDEX('Table 1'!$G:$G,AGGREGATE(15,6,ROW('Table 1'!$G$9:$G$1509)/(('Table 1'!$B$9:$B$1509="Awarded")*( 'Table 1'!$A$9:$A1509="Leeds")),ROWS($G$9:$G9))),"")

    is what I'd use...

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: IFERROR Function based on multiple criteria

    Next time I'd better do it in Xl, rather than free typing on the board.

    =IFERROR(INDEX('Table 1'!$G$9:$G$1509,AGGREGATE(15,6,(ROW('Table 1'!$G$9:$G$1509)-ROW('Table 1'!$G$9)+1)/(('Table 1'!$B$9:$B$1509="Awarded")*('Table 1'!$A$9:$A$1509="Leeds")),ROWS($G$9:$G9))),"")

  10. #10
    Registered User
    Join Date
    11-08-2019
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    10

    Re: IFERROR Function based on multiple criteria

    Thanks to you both - the formula is fixed and now working so all sorted. Much appreciated! Have a lovely evening

  11. #11
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: IFERROR Function based on multiple criteria

    You're welcome & thanks for the feedback

+ 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] Count of Distinct function/ Formula based on multiple criteria
    By naveeddil in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-08-2019, 06:34 PM
  2. IFERROR(SUMIF) function with multiple criteria
    By komacosplay in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-09-2018, 09:16 AM
  3. [SOLVED] SUMPRODUCT function count the Unique values based on Multiple criteria
    By savetrees in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-15-2018, 04:03 AM
  4. Max function based on multiple criteria
    By dobracik in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-14-2016, 01:49 PM
  5. [SOLVED] INDEX Function to return a value based on multiple criteria.
    By carterbu in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-23-2013, 03:02 PM
  6. Linking multiple IF statements to perform different Function Based on criteria
    By Kimberly@TM in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-26-2010, 02:44 PM

Tags for this Thread

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