답변됨 Ms Project 2007 Nested IIF statements

  • 2012년 5월 7일 월요일 오전 4:10
     
     

    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?

모든 응답

  • 2012년 5월 7일 월요일 오전 4:39
    중재자
     
     답변됨

    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

    • 답변으로 제안됨 Julie SheetsMVP, Moderator 2012년 5월 7일 월요일 오후 12:53
    • 답변으로 표시됨 Jobe78 2012년 5월 8일 화요일 오전 2:00
    •  
  • 2012년 5월 7일 월요일 오후 12:53
    중재자
     
     
    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.
  • 2012년 5월 7일 월요일 오후 1:45
     
     

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

  • 2012년 5월 8일 화요일 오전 2:02
     
     

    Thanks Brian!! Your solution worked. Very neat & tidy. Date format adjusted & no worries. Excellent work thanks for your response.


    Joshua Cullen

  • 2012년 5월 8일 화요일 오전 2:03
    중재자
     
     
    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

  • 2012년 5월 8일 화요일 오전 2:07
     
     

    Thank you for the link. A good read. I will use this for future template developments. :)


    Joshua Cullen