+ Reply to Thread
Results 1 to 15 of 15

Two INDEX conditions to be checked with 'IF' condition

  1. #1
    Forum Contributor
    Join Date
    02-22-2015
    Location
    India
    MS-Off Ver
    MS Office 2007
    Posts
    100

    Two INDEX conditions to be checked with 'IF' condition

    Greetings to all.

    How to check/combine the below 2 conditions with 'IF' condition?

    =INDEX(***,MATCH(***,***)) > A1 AND
    =INDEX(***,MATCH(***,***)) > B1

    Thanks in advance

  2. #2
    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,053

    Re: Two INDEX conditions to be checked with 'IF' condition

    Like this:

    =INDEX(TargetRange,MATCH(1,(Criterion1=CriterionRange1)*(Criterion2=CriterionRange2),0))

    entered as an array formula.

    Array Formulae are a little different from ordinary formulas in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly braces { } appear around the outside of your formula. If you do not CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...
    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

  3. #3
    Forum Contributor
    Join Date
    02-22-2015
    Location
    India
    MS-Off Ver
    MS Office 2007
    Posts
    100

    Re: Two INDEX conditions to be checked with 'IF' condition

    Quote Originally Posted by Glenn Kennedy View Post
    Like this:

    =INDEX(TargetRange,MATCH(1,(Criterion1=CriterionRange1)*(Criterion2=CriterionRange2),0))

    entered as an array formula.

    Array Formulae are a little different from ordinary formulas in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly braces { } appear around the outside of your formula. If you do not CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...
    This is the formula:
    =INDEX(B2:IA2,MATCH(9.9999999E+307,B2:IA2)) > IG2 AND =INDEX(B2:IA2,MATCH(9.9999999E+307,B2:IA2)) > IG2

    Can I get in your format Glenn, please..

  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,053

    Re: Two INDEX conditions to be checked with 'IF' condition

    What, exactly, are you trying to do?

  5. #5
    Forum Contributor
    Join Date
    02-22-2015
    Location
    India
    MS-Off Ver
    MS Office 2007
    Posts
    100

    Re: Two INDEX conditions to be checked with 'IF' condition

    Quote Originally Posted by Glenn Kennedy View Post
    What, exactly, are you trying to do?
    =INDEX(B2:IA2,MATCH(9.9999999E+307,B2:IA2)) returns X (for instance: 50.72)

    X needs to be greater than A (for instance: 50) and B (for instance: 40) cells' values.

    I am not much sure about how to do with the formula written by you; can you please help..

  6. #6
    Forum Contributor
    Join Date
    02-22-2015
    Location
    India
    MS-Off Ver
    MS Office 2007
    Posts
    100

    Re: Two INDEX conditions to be checked with 'IF' condition

    Am trying to compare a cell's value with other two cells (by 'IF' condition) for the written INDEX and MATCH formula..

  7. #7
    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,053

    Re: Two INDEX conditions to be checked with 'IF' condition

    =INDEX(B2:IA2,MATCH(9.9999999E+307,B2:IA2)) returns the last numerical value in the range B2-IA2. So, if the returned value is greater than value X and value Y... what do you want the result to be?????

  8. #8
    Forum Contributor
    Join Date
    02-22-2015
    Location
    India
    MS-Off Ver
    MS Office 2007
    Posts
    100

    Re: Two INDEX conditions to be checked with 'IF' condition

    Quote Originally Posted by Glenn Kennedy View Post
    =INDEX(B2:IA2,MATCH(9.9999999E+307,B2:IA2)) returns the last numerical value in the range B2-IA2. So, if the returned value is greater than value X and value Y... what do you want the result to be?????
    Result has to be PASS else FAIL, Glenn.

  9. #9
    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,053

    Re: Two INDEX conditions to be checked with 'IF' condition

    Try this, then.

    =if(and(INDEX(B2:IA2,MATCH(9.9999999E+307,B2:IA2))>A1,INDEX(B2:IA2,MATCH(9.9999999E+307,B2:IA2))>b1),"Pass","Fail")

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Two INDEX conditions to be checked with 'IF' condition

    Quote Originally Posted by LesliePrabakar View Post
    =INDEX(B2:IA2,MATCH(9.9999999E+307,B2:IA2)) returns X (for instance: 50.72)

    X needs to be greater than A (for instance: 50) and B (for instance: 40) cells' values.
    In other words X needs to be greater than the maximum of either 50 or 40?

    Maybe something like this...

    Data Range
    B
    C
    D
    E
    F
    G
    H
    I
    J
    1
    2
    4
    11
    13
    18
    75
    70
    72
    81
    41
    3
    4
    50
    40
    81
    5


    =LOOKUP(2,1/(B2:J2>MAX(B4:C4)),B2:J2)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  11. #11
    Forum Contributor
    Join Date
    02-22-2015
    Location
    India
    MS-Off Ver
    MS Office 2007
    Posts
    100

    Re: Two INDEX conditions to be checked with 'IF' condition

    Quote Originally Posted by Glenn Kennedy View Post
    Try this, then.

    =if(and(INDEX(B2:IA2,MATCH(9.9999999E+307,B2:IA2))>A1,INDEX(B2:IA2,MATCH(9.9999999E+307,B2:IA2))>b1),"Pass","Fail")
    Awesome, Glenn. Perfectly works for me.

    You are appreciated well for your time spent on this query and patience in understanding.

    Take good care.

  12. #12
    Forum Contributor
    Join Date
    02-22-2015
    Location
    India
    MS-Off Ver
    MS Office 2007
    Posts
    100

    Re: Two INDEX conditions to be checked with 'IF' condition

    Quote Originally Posted by Tony Valko View Post
    In other words X needs to be greater than the maximum of either 50 or 40?

    Maybe something like this...

    Data Range
    B
    C
    D
    E
    F
    G
    H
    I
    J
    1
    2
    4
    11
    13
    18
    75
    70
    72
    81
    41
    3
    4
    50
    40
    81
    5


    =LOOKUP(2,1/(B2:J2>MAX(B4:C4)),B2:J2)
    Thanks so much Tony for the reply.

  13. #13
    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,053

    Re: Two INDEX conditions to be checked with 'IF' condition

    Glad to have helped. Sorry it took a while, though....

  14. #14
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Two INDEX conditions to be checked with 'IF' condition

    I may not have understood the requirement.

  15. #15
    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,053

    Re: Two INDEX conditions to be checked with 'IF' condition

    That's not like you, T. You're usually bang on target...

+ 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] how to use if condition to check whether checkbox is checked
    By Bronx in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-12-2016, 02:47 AM
  2. [SOLVED] Conditional Date Calculation after conditions have been checked
    By msgman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-01-2014, 12:49 PM
  3. Check Box that shows options in Combo Box if Checked, and Hides if Not Checked
    By dumbjodie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-13-2013, 10:06 AM
  4. [SOLVED] When checkbox is checked it does not copy to new sheet. Only if not checked using false
    By thelisa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-28-2013, 07:59 AM
  5. Replies: 29
    Last Post: 02-26-2013, 02:13 PM
  6. Replies: 2
    Last Post: 12-19-2012, 11:23 PM
  7. Replies: 1
    Last Post: 12-17-2005, 05:56 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