Can I get a Duration custom field to display the value in Weeks? RRS feed

  • Question

  • I have created a custom Duration field in a project plan [Duration1]. I use this field to calculate the duration between two Dates for a Task thusly:

    IIf((([Date1]=ProjDateValue("NA")) Or ([Date2]=ProjDateValue("NA"))),0,ProjDateDiff([Date1],[Date2]))

    Which works fine.

    What I would like is for the column, when displayed in a table, to give the Duration in Weeks, rather than the default Days... but without changing the Project Option for duration (i.e. I want all other Durations to continue to be displayed in Days - it is just this single custom field I would like to see as weeks).

    Can I get a custom Duration field to display values in weeks - without changing the Project options for all durations?

    Wednesday, March 16, 2016 4:47 PM


All replies

  • Yep, try:


    Rod Gill
    Author of the one and only Project VBA Book

    • Proposed as answer by Ismet Kocaman Thursday, March 17, 2016 11:51 AM
    • Marked as answer by KevinPB Thursday, March 17, 2016 12:00 PM
    Wednesday, March 16, 2016 9:01 PM
  • Thanks for this, Rod, but I'm afraid it doesn't work. I had been trying ProjDurConv before and thought I hadn't got the syntax right.

    Creating a second Duration custom field, using exactly your syntax above, and the column in the table continues to show as Days;

    I've then looked to using your formula into a Number custom field, but that gives #ERROR.

    Thanks for your help, but it looks like I will need to manipulate the data in Excel when exported for reporting.

    Thursday, March 17, 2016 10:49 AM
  • Rod's formula works, just use a custom text field since the function's output is a text.

    Ismet Kocaman | Learn Formulas | Articles | Connect

    • Marked as answer by KevinPB Thursday, March 17, 2016 12:00 PM
    Thursday, March 17, 2016 11:51 AM
  • Okay, thank you Ismet. That, indeed, has given me a column showing the Duration in weeks.
    Thursday, March 17, 2016 12:00 PM