+ Reply to Thread
Results 1 to 12 of 12

IF/ELSE Statement

  1. #1
    Registered User
    Join Date
    04-17-2008
    Posts
    3

    IF/ELSE Statement

    Need help combining mulitiple if/else statements into a single formulat that I can type into a cell. What I'm trying to say is as follows:

    If the date in cell I7 is later than 3/12/2008 then display the word 'Active';
    If the date in cell I7 is earlier than 3/12/2008 but later than 12/23/2007, display the world 'Inactive';
    If the date in cell I7 is earlier than 12/23/2007, display the word 'Disabled'

    What I have so far is this:
    =IF(($I7>"3/12/2008"+0), "Active", "")*($I7<=datevalue("3/12/2008)*($I7>=datevalue("12/23/2007"), ("Disabled", "")

    I saw the below statement online, but am not sure how to translate that to a single formula that I can type into a cell.

    if (name == "mini") {
    alert("your name is mini")
    }
    else if (name == "harold") {
    alert("your name is harold")
    }
    else if (name == "fred") {
    alert("your name is fred")
    }
    else {
    alert("Your name is not mini, harold or fred")
    }

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try:

    Please Login or Register  to view this content.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    04-17-2008
    Posts
    3

    IF/ELSE Statements

    Thank you for the formula. It works! I wondered if it would be possible to add in the "blank" condition. For example, how do you include a statement for an empty cell. I tried adding it into your statement and came up with the following:

    =IF(I7<DATE(2007,12,23),"Disable",IF(I7<DATE(2008,3,12),"Inactive","Active"),IF(I7="", "Never"))

    But, received the error message: you have too many statements...

    Is there another method?

    Essentially, I'm trying to say the following:

    If the date in cell I7 is blank, then enter the word 'Never'

    Thanks again.

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    Try it this way

    =IF(I7="","Never",IF(I7<DATE(2007,12,23),"Disable",IF(I7<DATE(2008,3,12),"Inactive","Active")))
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF/ELSE Statement

    commissionxpert,

    Please stop randomly posting in threads with links to outside webpages.

    You will be banned if I catch another.

  6. #6
    Registered User
    Join Date
    04-15-2010
    Location
    Santa Barbara, CA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: IF/ELSE Statement

    Hello,

    I'm driving ymself crazy with this and need some help. I'm basically trying to say:
    If my date in cell BE11 is prior to 11/16/2011 then its "Past due". If the date is after 12/16/2011 then its "Current". And if the date is neither of those two then its "Within a month".

    Here's what I have:

    =IF(BG11<DATE(11,16,2011),"Past due",IF(BG11>DATE(12,16,2011),"Current","Within a month"))

    Right now I have a date of 9/12/2011 and it says "Current", when I toggle the sign to be >, its shows "Past due". But then when I go to change my date in BE11 to, for exmaple, 3/12/2012, it never changes to "Current". I'm missing something! Appreciate any help!

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF/ELSE Statement

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.

  8. #8
    Registered User
    Join Date
    04-15-2010
    Location
    Santa Barbara, CA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: IF/ELSE Statement

    Thanks. I need to figure out how to post a new thread and delete this one.

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF/ELSE Statement

    Select an appropriate forum from the forum Index: http://www.excelforum.com/index.php and click New Post....

  10. #10
    Registered User
    Join Date
    04-27-2012
    Location
    Burbank, CA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: IF/ELSE Statement

    *** Removed to start a new thread ***
    Last edited by BornInTheBronx; 04-27-2012 at 01:30 PM.

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF/ELSE Statement

    See post # 7 above.

  12. #12
    Forum Contributor
    Join Date
    09-06-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    225

    Re: IF/ELSE Statement

    this was helpful, thanks!
    "The only real restraint that exists is not believing that it can be done."

    -Nick Gardone

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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