+ Reply to Thread
Results 1 to 11 of 11

IF with multiple conditions

  1. #1
    Registered User
    Join Date
    02-27-2014
    Location
    Lithuania, Klaipeda
    MS-Off Ver
    Excel 2013
    Posts
    96

    IF with multiple conditions

    I have few columns that I would like to filter based on specific conditions:
    1. If B:B value is “No info” AND A:A value is from 8-12 then it should return “SEND”.
    2. If B:B value is NOT “No info” AND C:C value is less than 8 then it should return “SEND”.
    3. If value in A:A is 30 or higher than it should return: FUTURE
    4. If value in A:A is 7 or lower than it should return: PAST
    Would it be possible to put at least first two conditions in one formula? Example is in the sheet. Also if possible last 2 conditions could also be applied.
    Thank you very much for assistance.
    Attached Files Attached Files
    Last edited by purlo; 05-13-2020 at 07:54 AM.

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: IF with multiple conditions

    =IF(AND(B2="No info", A2>=8, A2<=12),"Send",IF(AND(B2<>"No info", C2<8),"Send",IF(A2>=30,"Future",IF(A2<=7,"Past",""))))
    is what you asked for

    but line 2 should be future not send according to your answer? probably with a lack of precsion on <= or <
    =IF(AND(B2="No info", A2>=8, A2<=12),"Send",IF(AND(B2<>"No info", C2<=8),"Send",IF(A2>=30,"Future",IF(A2<=7,"Past",""))))
    Last edited by davsth; 05-13-2020 at 08:05 AM.

  3. #3
    Registered User
    Join Date
    02-27-2014
    Location
    Lithuania, Klaipeda
    MS-Off Ver
    Excel 2013
    Posts
    96

    Re: IF with multiple conditions

    Thank you very much!
    So first two conditions should be applied whole column and return only “SEND”. For some reason I have more results now, so I upload bigger file to help you understand the scope. But in a nutshell it should return SEND if:
    1. As a rule if A:A is between 8-12 should return SEND without expectations.
    Additionally:
    2. IF A:A is between 12-30 and value in B:B is NOT “No info”, PLUS C:C value is less than 8 then it should return “SEND”
    i. If value in B:B is “No info” PLUS A:A value is from 8-12 then it should return “SEND”. (This already work well) Thanks!
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,293

    Re: IF with multiple conditions

    Formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-27-2014
    Location
    Lithuania, Klaipeda
    MS-Off Ver
    Excel 2013
    Posts
    96

    Re: IF with multiple conditions

    Hey, thanks a lot it really looks good. I just checked that in some cases if A:A is 7 or less, it shows SEND, but it should not be PAST. It seems it is because formula finds value in C:C less than 8: (TRUNC(C64)<8). But this should be applied only if condition A:A is between 8-12 is met.
    I see that it get little bit complicated. It would be enough if formula returns correct SEND results. PAST and FUTURE is helpful but it is not a main concern.
    Everything else seems to work very fine, besides the point above, if you could modify it I would be very grateful!
    Attached Files Attached Files
    Last edited by purlo; 05-14-2020 at 03:36 AM.

  6. #6
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: IF with multiple conditions

    You just need to restate your conditions, if previous conditions are met, you do not get to the later conditions
    1. If B:B value is “No info” AND A:A value is from 8-12 then it should return “SEND”.
    2. If B:B value is NOT “No info” AND C:C value is less than 8 then it should return “SEND”.
    3. If value in A:A is 30 or higher than it should return: FUTURE
    4. If value in A:A is 7 or lower than it should return: PAST

    2. If B:B value is NOT “No info” AND C:C value is less than 8 and A:A >7, then it should return “SEND”.


    =IF(AND(B2="No info",A2>=8,A2<=12),"Send",IF(AND(B2<>"No info",C2<=8,A2>7),"Send",IF(A2>=30,"Future",IF(A2<=7,"Past",""))))


    is this what you mean?

  7. #7
    Registered User
    Join Date
    02-27-2014
    Location
    Lithuania, Klaipeda
    MS-Off Ver
    Excel 2013
    Posts
    96

    Re: IF with multiple conditions

    Hey, thank you. It seems that it still returns SEND to A:A 30 or higher, unless the condition B:B "No info" is met. But if this condition is not met, then it shows that it should be sent, even if A:A is not between 8-12. And it still shows EMPTY when A:A is between 8-12

  8. #8
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: IF with multiple conditions

    As I said restate your conditions in order if condition 1 is met you do not get to condition 2 etc

    2. If B:B value is NOT “No info” AND C:C value is less than 8 then it should return “SEND”.
    3. If value in A:A is 30 or higher than it should return: FUTURE

    2 is fulfilled before 3 so if its is true it will

    otherwise this will contunally be being tinkered with

    someone will work out a formula

  9. #9
    Registered User
    Join Date
    02-27-2014
    Location
    Lithuania, Klaipeda
    MS-Off Ver
    Excel 2013
    Posts
    96

    Re: IF with multiple conditions

    So it should be something like this, but there is an error:
    =IF(A801>=30,"Future",IF(A801<=8,"Past",""),IF(AND(A801>=8,A801<13),"Send",IF(AND(B801="No info",A801>=8,A801<13),"Send",IF(AND(B801<>"No info",C801<8,A801>7),"Send",)))
    Maybe it is also possible to add condition C:C not less than 8, but between 1-8
    Last edited by purlo; 05-14-2020 at 09:58 AM.

  10. #10
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: IF with multiple conditions

    I think you are close, but have got a bit lost over brackets
    write condition 1 as =IF(A801>=30,"Future",9999)
    then write condition 2 as IF(A801<=8,"Past",9999)

    now paste condition 2 into condition one replacing the 9999
    IF(A801>=30,"Future",IF(A801<=8,"Past",9999))

    now 3
    IF(A801>=30,"Future",IF(A801<=8,"Past",IF(AND(A801>=8,A801<13),"Send",9999)))


    and keep going for condition 3, 4, 5, etc, this is an easy way of keeping track of brackets in a long formula

    tidying your formula
    =IF(A801>=30,"Future",IF(A801<=8,"Past",IF(AND(A801>=8,A801<13),"Send",IF(AND(B801="No info",A801>=8,A801<13),"Send",IF(AND(B801<>"No info",C801<8,A801>7),"Send","")))))

  11. #11
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,293

    Re: IF with multiple conditions

    For example, in cell A1, you have the number 2.28571428571428, as well as fractional numbers in all other cells, so I applied the TRUNC function to ensure that the set conditions are met without errors.
    I corrected the error in the formula, but now in some cells the value FALSE appeared.
    867711202
    Attached Files Attached Files

+ 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] Help for IF conditions with multiple Conditions (scenario more than 5 conditions)
    By meily_o26 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-16-2019, 02:13 AM
  2. Replies: 29
    Last Post: 01-01-2017, 10:25 AM
  3. Replies: 2
    Last Post: 01-14-2016, 03:53 PM
  4. [SOLVED] Vlookup - Country conditions (Multiple conditions)
    By dluhut in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-26-2013, 11:42 AM
  5. Replies: 0
    Last Post: 08-14-2012, 01:18 PM
  6. Replies: 1
    Last Post: 12-05-2010, 04:39 AM
  7. How to multiple conditions to validate more than 2 conditions to .
    By Bhuvana Govind in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-28-2005, 04:06 PM

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