+ Reply to Thread
Results 1 to 13 of 13

IF function with 3 condition

  1. #1
    Forum Contributor
    Join Date
    03-05-2015
    Location
    Cambodia
    MS-Off Ver
    2016
    Posts
    118

    IF function with 3 condition

    Hello All,

    I would like to use if formula to set up with 3 conditions but i'm always getting conflict.

    Anyone, please help me.

    condition i want to use in attached excel file.
    if Aging less than 28days there is no reminder
    * Reminder I: in between 28-41days
    * Reminder II: in between 42-59days
    * reminder III: start from 60days on ward

    Thanks,
    leakhna
    Attached Files Attached Files

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: IF function with 3 condition

    Here's one way. In E4;
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    And copy down.

  3. #3
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: IF function with 3 condition

    Here you go:
    =IF(C4<28,"",IF(AND(C4>=28,C4<=41),"R1",IF(AND(C4>=42,C4<=59),"R2",IF(C4>=60,"R3",""))))

  4. #4
    Forum Contributor
    Join Date
    03-05-2015
    Location
    Cambodia
    MS-Off Ver
    2016
    Posts
    118

    Re: IF function with 3 condition

    Hi,

    Thanks for the formula it works but I just found that there one is different from another brand as as below:

    ==> if it names "Baby" then whenever the age over than 21days it will be as an "alert".
    Attached Files Attached Files

  5. #5
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: IF function with 3 condition

    Just add another condition. You should check the nested ifs

    =IF(AND(B4="Baby",C4>=21),"Baby/Alert",IF(C4<28,"",IF(AND(C4>=28,C4<42),"Reminder I",IF(AND(C4>=42,C4<60),"Reminder II","Reminder III"))))

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

    Re: IF function with 3 condition

    As the formula evaluates the conditions in order AND(C4>=28,C4<42) is the same as c4<42, so the formula can be reduced

    =IF(AND(B4="Baby",C4>=21),"Baby/Alert",IF(C4<28,"",IF(C4<42,"Reminder I",IF(C4<60,"Reminder II","Reminder III"))))

  7. #7
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: IF function with 3 condition

    Hi,

    Here's another way.

    In your description, you say for Baby, "older than 21 days", yet your sample shows "Alert" for 21 days, so remove the "equal" part in red if necessary:

    =IF(AND(B4="Baby",C4>=21),"Alert",LOOKUP(C4,{0,28,42,60},{"","Reminder I","Reminder II","Reminder III"}))

    See attached.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    03-05-2015
    Location
    Cambodia
    MS-Off Ver
    2016
    Posts
    118

    Re: IF function with 3 condition

    Hello everyone,

    I like to add more condition on Baby which have a different condition.

    Thank for check it for me.
    Attached Files Attached Files
    Last edited by leakhna; 07-26-2018 at 02:54 AM.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,990

    Re: IF function with 3 condition

    Solved tag removed to allow further participation.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  10. #10
    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,067

    Re: IF function with 3 condition

    Try:

    =IF(B4="baby",IF(AND(C4>=21,C4<35),"Reminder I",IF(AND(C4>=35,C4<48),"Reminder II",IF(AND(C4>=35,C4>=48),"Reminder III",""))),IF(AND(C4>=28,C4<42),"Reminder I",IF(AND(C4>=42,C4<60),"Reminder II",IF(AND(C4>=42,C4>=60),"Reminder III",""))))

    There is a mistake (I think) in your expected answer for number 14 (row 17).
    Attached Files Attached Files
    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

  11. #11
    Forum Contributor
    Join Date
    03-05-2015
    Location
    Cambodia
    MS-Off Ver
    2016
    Posts
    118

    Re: IF function with 3 condition

    Big thanks.


  12. #12
    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,067

    Re: IF function with 3 condition

    You're welcome and thanks for the rep.

  13. #13
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: IF function with 3 condition

    Hi,

    Late to the party (different time zone), I don't understand the use of all the ANDs, here's a simplified version of the Nested IF:

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


    And here's my LOOKUP suggestion:

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


    See attached for Both samples.
    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] MAX function + condition
    By Spikyd in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-11-2017, 08:20 AM
  2. [SOLVED] Sum function with a condition
    By luizmachado in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-02-2016, 03:49 PM
  3. [SOLVED] IF function, I need one more condition
    By rwbaldwin0728 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-02-2013, 06:07 AM
  4. [SOLVED] Can I add an 'or' condition to the COUNTIF function? If not, what other function can I use
    By newbie0101 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-09-2012, 01:41 AM
  5. Many Condition with IF Function
    By Aumkar in forum Excel General
    Replies: 10
    Last Post: 07-30-2010, 08:08 AM
  6. If function 10 condition
    By Sam.K in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 11-01-2008, 11:20 PM
  7. [SOLVED] max function with condition
    By shaji in forum Excel General
    Replies: 4
    Last Post: 07-10-2006, 12:19 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