none
Ms Project 2007 Nested IIF statements RRS feed

  • Question

  • Hi, Iam customising a text field to reflect what day an activity falls on. ie  if a taskis dated for the 13th July then that would be Day 2. The below formula is what I have already. This works up to 8 IIF statements then fails there afterwards. Has anyone any ideas ? Are you only able to perform a set amount of IIF statements?

    Monday, May 7, 2012 4:10 AM

Answers

  • Try this instead:

    "Day " & DateDiff("D","7/11/2012",[Start])

    Im using the MM/DD/YYYY format so adjust if you use DD/MM/YYYY


    Brian Kennemer - Project MVP
    DeltaBahn Senior Architect
    endlessly obsessing about Project Server…so that you don’t have to.
    Blog | Twitter | LinkedIn

    Monday, May 7, 2012 4:39 AM
    Moderator

All replies

  • Try this instead:

    "Day " & DateDiff("D","7/11/2012",[Start])

    Im using the MM/DD/YYYY format so adjust if you use DD/MM/YYYY


    Brian Kennemer - Project MVP
    DeltaBahn Senior Architect
    endlessly obsessing about Project Server…so that you don’t have to.
    Blog | Twitter | LinkedIn

    Monday, May 7, 2012 4:39 AM
    Moderator
  • I would not be surprised to discover that Project has limitations on arguments, similar to Excel.  You may be able to coax a few more options from a Switch statement but even then you are going to run out of options.  Brian's suggestion calculates the day for you without all of the hassle of counting each day.
    Monday, May 7, 2012 12:53 PM
    Moderator
  • >> "Day " & DateDiff("D","7/11/2012",[Start])

    This is a good solution. I agree with Julie.

    IMO; the limits are not documented in Project help pages or in any other place. Project has similar functions but the limits are quite different than that of Excel and Access. Limits may further change, depending on the length of strings used in expressions. We need to find out by testing.

    I would also suggest you read Jim Aksel's (Project MVP) "Project Day Numbering" article here at http://www.mpug.com/News/Pages/ProjectDateNumbering.aspx

    Regards.

    Monday, May 7, 2012 1:45 PM
  • Thanks Brian!! Your solution worked. Very neat & tidy. Date format adjusted & no worries. Excellent work thanks for your response.


    Joshua Cullen

    Tuesday, May 8, 2012 2:02 AM
  • No Problem. Good thought with the nested iffs but they do have limitations and this solution will workf for any date so you dont have to hard code.

    Brian Kennemer - Project MVP
    DeltaBahn Senior Architect
    endlessly obsessing about Project Server…so that you don’t have to.
    Blog | Twitter | LinkedIn

    Tuesday, May 8, 2012 2:03 AM
    Moderator
  • Thank you for the link. A good read. I will use this for future template developments. :)


    Joshua Cullen

    Tuesday, May 8, 2012 2:07 AM