+ Reply to Thread
Results 1 to 12 of 12

Thread: IF Function- Deadline dates and Status

  1. #1
    Registered User
    Join Date
    11-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    9

    IF Function- Deadline dates and Status

    Hi guys, can you help me please?

    Let me explain it a bit better... i hope

    In Cell A2 I have a Deadline Month e.g May-11. Now depending on what the current month is I need to enter a value in cell B2. The paramaters are:
    1st: If the Deadline Date is <=6 months from the Current Month enter in cell B3 "Deadline <=6"
    2nd If the Deadline Date is greater than 6 months BUT less than 12 months enter in "Deadline >6<12"
    3rd: If the Deadline Date is greater than 12 months enter in "Deadline >12"

    I can't seem to work out the 2nd parameter - between 6 and 12 months.

    Your help would be greatly appreciated once again
    Mike
    Last edited by zeppelinmike; 11-11-2011 at 05:34 AM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    MS 2007
    Posts
    5,372

    Re: IF Function- Deadline dates and Status

    If you want it to show like your example
    Try

    =CHOOSE(SIGN(B2-A2)+2,"WD", "Competed", "OD")
    ChemistB
    My 2¢

    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

  3. #3
    Valued Forum Contributor alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Lake County, Illinois
    MS-Off Ver
    MS Office 2010, 2007 and 2002
    Posts
    1,165

    Re: IF Function- Deadline dates and Status

    Try this:

    =IF(MONTH(A2)=MONTH(B2),"Completed",IF(MONTH(B2)-MONTH(A2)<=6,"WD","BD"))

    Alan

  4. #4
    Forum Guru 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Vienna, VA, USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    2,257

    Re: IF Function- Deadline dates and Status

    If you can stand another option, here it is. I didn't use your statuses (for reasons you'll see below) but I am showing status that should be very clear what they mean.

    =LOOKUP(YEAR(B1)*12+MONTH(B1)-YEAR(A1)*12-MONTH(A1),{-99,0,1,6,12,13},{"Early","On Time","<=6","<=12",">12"})

    However, I must note that your description does not sync with the example you listed. Your status does not distinguish between >6 and >12, and I'm not sure what you mean by Completed. Once it is completed, do you always change the deadline to match the finish date? And do I understand correctly that something done 6 months late is still considered "within deadline"?
    Last edited by 6StringJazzer; 11-10-2011 at 06:13 PM. Reason: Screwed up and left test cells in my formula, corrected with blue text
    Making the world a better place one fret at a time
    ||||||

    If someone helped you, please click on the star icon at the bottom of their post

    If your problem is solved, please update the first post:
    EDIT, Go Advanced button, set Prefix to SOLVED

    [code]
    ' Enclose code in tags like this
    [/code]

    Don't attach a screenshot
    --just attach your Excel file! It's easier and will let us experiment with your data, formulas, and code.

  5. #5
    Forum Guru 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Vienna, VA, USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    2,257

    Re: IF Function- Deadline dates and Status

    Quote Originally Posted by alansidman View Post
    Try this:

    =IF(MONTH(A2)=MONTH(B2),"Completed",IF(MONTH(B2)-MONTH(A2)<=6,"WD","BD"))

    Alan
    This will not work if the months are in two different years.

  6. #6
    Registered User
    Join Date
    11-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    9

    Smile Re: IF Function- Deadline dates and Status

    Let me explain it a bit better... i hope

    In Cell A2 I have a Deadline Month e.g May-11. Now depending on what the current month is I need to enter a value in cell B2. The paramaters are:
    1st: If the Deadline Date is <=6 months from the Current Month enter in cell B3 "Deadline <=6"
    2nd If the Deadline Date is greater than 6 months BUT less than 12 months enter in "Deadline >6<12"
    3rd: If the Deadline Date is greater than 12 months enter in "Deadline >12"

    I can't seem to work out the 2nd parameter - between 6 and 12 months.

    Your help would be greatly appreciated once again
    Mike
    Last edited by zeppelinmike; 11-11-2011 at 05:34 AM.

  7. #7
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,056

    Re: IF Function- Deadline dates and Status

    Try using DATEDIF, i.e.

    =IF(A2="","","Deadline "&LOOKUP(DATEDIF(A2,TODAY(),"m"),{0,6,12;"<=6",">6<12",">12"}))
    Audere est facere

  8. #8
    Registered User
    Join Date
    11-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: IF Function- Deadline dates and Status

    Works a treat Daddylonglegs! Now could I add an OR into this formula. For example if cell B3 has a actual completion date within it - i want cell B2 to just state "Completed'

    Your help on this greatly appreciated by an nofice Excel user!

  9. #9
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,056

    Re: IF Function- Deadline dates and Status

    If A2 has the deadline month, B2 is either blank or has a completion date then formula in C2 can be as follows:

    =IF(A2="","",IF(B2<>"","Completed","Deadline "&LOOKUP(DATEDIF(A2,TODAY(),"m"),{0,6,12;"<=6",">6<12",">12"})))
    Audere est facere

  10. #10
    Registered User
    Join Date
    11-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: IF Function- Deadline dates and Status

    Thanks very much! That worked great! Much appreciated daddylonglegs!

  11. #11
    Registered User
    Join Date
    11-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: IF Function- Deadline dates and Status

    Hi Daddylonglegs, sorry to bother you again but I forgot to consider future dates i.e. future project deadline dates not reached yet. For example, if cell A2 has a deadline date greater than the current month - I would like the Status cell (C2) to input "Within Deadline".

    When I tested this using your formula I received the #N/A! error.

    I'm gradually getting to understand how IF formulas are created - with your help you've done for me so far, thanks again"

  12. #12
    Registered User
    Join Date
    11-10-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: IF Function- Deadline dates and Status

    Hi Daddylonglegs, sorry to bother you again but I forgot to consider future dates i.e. future project deadline dates not reached yet. For example, if cell A2 has a deadline date greater than the current month - I would like the Status cell (C2) to input "Within Deadline".

    When I tested this using your formula I received the #N/A! error.

    I'm gradually getting to understand how IF formulas are created - with your help you've done for me so far, thanks again"

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0