Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: IF Function with Multiple Criteria

  1. #1
    Member
    Join Date
    Apr 2011
    Posts
    69
    Rep Power
    14

    IF Function with Multiple Criteria

    I have following formula wherein first part of the formula excludes 14 and 51 from the calculation, now i want to add in exclusion 61 as well. Any solution for the flexible formula where i can keep on adding any number to exclusion. kindly assist


    =IF(AND(I3<>14,I3<>51),IF(AND(K3>=$KP$1,K3<=$KQ$1) ,(U3*20653750)/$D$3257,0),IF(I3=14,IF(AND(K3>=$KP$1,K3<=$KQ$1),(U 3*150030)/$D$3262,0),0))


    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9c-vOQApTgb
    https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9c-vbihZ-7W
    https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9c-vfmpSO0F
    https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9c-vjfTJ7lX
    https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9c-vmq-LHHz
    https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9c-vst3j_7i
    https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9bwBqjIR5Nj
    https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9bwBw8El0r5
    https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9bwC63GbRuM
    https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9bwC9fyKZdo
    https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9bwCEn8DBQe
    https://www.youtube.com/watch?v=nVy4GAtkh7Q&lc=UgxJGNhWFZh2p5mK0XB4AaABAg. 9bbxud383FI9bw0Bey8gQO
    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    Last edited by DocAElstein; 09-22-2023 at 05:33 PM.
    ----
    excel_learner
    (Using XL 2007 & 2010)

    -------Learning never stops!

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    HI,

    Try

    =IF(ISNA(MATCH(I3,{14,51,61},0)),IF(AND(K3>=$KP$1,K3<=$KQ$1),(U3*20653750)/$D$3257,0),IF(I3=14,IF(AND(K3>=$KP$1,K3<=$KQ$1),(U 3*150030)/$D$3262,0),0))

    You could replace the array (in red ) with a range as well.
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  3. #3
    Member
    Join Date
    Apr 2011
    Posts
    69
    Rep Power
    14
    Great, its working. if i want other way arround i have to remove ISNA, is it?
    Thanks
    ----
    excel_learner
    (Using XL 2007 & 2010)

    -------Learning never stops!

  4. #4
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi,

    No, ISNA will still be there. Just replace those array of values with a range.
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  5. #5
    Member
    Join Date
    Apr 2011
    Posts
    69
    Rep Power
    14
    Quote Originally Posted by Admin View Post
    HI,

    Try

    =IF(ISNA(MATCH(I3,{14,51,61},0)),IF(AND(K3>=$KP$1,K3<=$KQ$1),(U3*20653750)/$D$3257,0),IF(I3=14,IF(AND(K3>=$KP$1,K3<=$KQ$1),(U 3*150030)/$D$3262,0),0))

    You could replace the array (in red ) with a range as well.
    In the above formula if I want to add another range match(N3,{CA,CN,KR} without changing the first one , how would I do that?

    Kindly assist.
    ----
    excel_learner
    (Using XL 2007 & 2010)

    -------Learning never stops!

  6. #6
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi

    Not sure whether you want to match or not to match.

    1. to match N3 with the array

    =IF(ISNA(MATCH(I3,{14,51,61},0)),IF(MATCH(N3,{"CA" ,"CN","KR"},0),IF(AND(K3>=$KP$1,K3<=$KQ$1),(U3*206 53750)/$D$3257,0),IF(I3=14,IF(AND(K3>=$KP$1,K3<=$KQ$1),(U 3*150030)/$D$3262,0),0)))

    2. This will exclude the match

    =IF(ISNA(MATCH(I3,{14,51,61},0)),IF(ISNA(MATCH(N3, {"CA","CN","KR"},0)),IF(AND(K3>=$KP$1,K3<=$KQ$1),( U3*20653750)/$D$3257,0),IF(I3=14,IF(AND(K3>=$KP$1,K3<=$KQ$1),(U 3*150030)/$D$3262,0),0)))
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  7. #7
    Member
    Join Date
    Apr 2011
    Posts
    69
    Rep Power
    14
    Thanks, however, the second formula gives me FALSE for values excluded in first match i.e 14,51,61. And first formula gives me N/A#. Can this be fixed with and / or, as i want both match excluded from the calculation. e.g if it finds 14,51,61 and also ca,cn,kr the formula should return 0.

    I hope the above is clear.
    ----
    excel_learner
    (Using XL 2007 & 2010)

    -------Learning never stops!

  8. #8
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi

    Does this

    =IF(ISNA(MATCH(I3,{14,51,61},0)),IF(ISNA(MATCH(N3, {"CA","CN","KR"},0)),IF(AND(K3>=$KP$1,K3<=$KQ$1),( U3*20653750)/$D$3257,IF(I3=14,IF(AND(K3>=$KP$1,K3<=$KQ$1),(U3*1 50030)/$D$3262,0),0))),0)

    correct result ?
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  9. #9
    Member
    Join Date
    Apr 2011
    Posts
    69
    Rep Power
    14
    not working bracket error, my original formula is as below, it does not move,

    =IF(ISNA(MATCH(I3,PC_CC,0)),IF(ISNA(MATCH(R3,Risk_ country,0)),IF(AND(K3>=$KP$1,K3<=$KQ$1),(U3*206537 50)/$D$4772,0),IF(I3=14,IF(AND(K3>=$KP$1,K3<=$KQ$1),(U 3*150030)/$D$4779,0),0))),0) where pc_cc includes 14,51,33 etc and risk_country includes CN, RU, etc.

    and if i change to

    =IF(ISNA(MATCH(I3,PC_CC,0)),IF(ISNA(MATCH(R3,Risk_ country,0)),IF(AND(K3>=$KP$1,K3<=$KQ$1),(U3*206537 50)/$D$4772,0),IF(I3=14,IF(AND(K3>=$KP$1,K3<=$KQ$1),(U 3*150030)/$D$4779,0),0)),0)

    it does not perform the IF(I3=14,IF(AND(K3>=$KP$1,K3<=$KQ$1),(U3*150030)/$D$4779,0),0)),0) returns 0.
    Last edited by excel_learner; 06-04-2012 at 02:26 PM.
    ----
    excel_learner
    (Using XL 2007 & 2010)

    -------Learning never stops!

  10. #10
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    =IF(ISNA(MATCH(I3,PC_CC,0)),IF(ISNA(MATCH(R3,Risk_ country,0)),IF(AND(K3>=$KP$1,K3<=$KQ$1),(U3*206537 50)/$D$4772,IF(I3=14,IF(AND(K3>=$KP$1,K3<=$KQ$1),(U3*1 50030)/$D$4779),0)),0),0)
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

Similar Threads

  1. Replies: 7
    Last Post: 05-15-2013, 02:56 PM
  2. Vlookup with multiple criteria
    By patsir in forum Excel Help
    Replies: 7
    Last Post: 08-27-2012, 11:15 AM
  3. Replies: 4
    Last Post: 08-11-2012, 10:50 PM
  4. Count with Multiple Criteria
    By candygirl in forum Excel Help
    Replies: 3
    Last Post: 12-11-2011, 07:02 PM
  5. Lookup on Multiple Criteria
    By ramakrishnan in forum Excel Help
    Replies: 4
    Last Post: 09-15-2011, 10:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •