Forum Discussion

Bhatia's avatar
Bhatia
Copper Contributor
Nov 12, 2024

Inconsistent Values from PWA Custom Field Formula

Hello community.

Greetings from first time poster.

I created the following formula (“FY Project Completion”) to assign a Financial Year value based on Project Finish Date (“Finish”): if the project ends on or before June 30, 2024, Financial year will be FY24, if the project end date falls between Jul 1, 2024 and June 30, 2025, the Financial Year will be FY25, and so on.

 

IIf([Finish] >= CDate(#7/1/2024#) And [Finish] <= CDate(#6/30/2025#), "FY25", IIf([Finish] >= CDate(#7/1/2025#) And [Finish] <= CDate(#6/30/2026#), "FY26", IIf([Finish] >= CDate(#7/1/2026#) And [Finish] <= CDate(#6/30/2027#), "FY27", IIf([Finish] >= CDate(#7/1/2027#) And [Finish] <= CDate(#6/30/2028#), "FY28", "FY24"))))

 

Surprisingly, the formula gives inconsistent FY values, even for projects with same Finish Date: sometimes it is blank, other times it assigns different FY values.

I am attaching a representative listing of about 40 projects, 23 of which have wrong FY value.

I will very much appreciate it if somebody can please guide me where I need to make change in the formula to get correct values? 

Dummy Project NameStartFinishFY Project Completion
Project in Row 211/13/20184/30/2021FY24
Project in Row 33/24/20233/24/2023FY25
Project in Row 412/14/20203/29/2023 
Project in Row 53/2/20207/31/2023FY24
Project in Row 610/25/202311/22/2023FY25
Project in Row 71/3/202212/31/2023FY25
Project in Row 84/6/20202/9/2024FY24
Project in Row 99/7/20233/1/2024FY25
Project in Row 101/3/20233/29/2024FY24
Project in Row 114/1/20244/1/2024FY24
Project in Row 124/1/20244/1/2024FY24
Project in Row 134/8/20244/8/2024FY24
Project in Row 144/8/20244/8/2024FY24
Project in Row 153/29/20245/9/2024FY24
Project in Row 165/16/20245/16/2024FY25
Project in Row 1711/14/20235/28/2024FY24
Project in Row 186/11/20246/11/2024FY25
Project in Row 197/26/20236/28/2024FY24
Project in Row 201/3/20236/28/2024FY25
Project in Row 211/2/20246/28/2024FY25
Project in Row 221/3/20236/28/2024FY25
Project in Row 231/3/20236/28/2024FY24
Project in Row 241/3/20236/28/2024FY24
Project in Row 251/3/20236/28/2024FY26
Project in Row 261/3/20236/28/2024FY24
Project in Row 277/27/20236/28/2024FY25
Project in Row 281/24/20246/28/2024FY25
Project in Row 291/3/20236/28/2024FY24
Project in Row 301/3/20236/28/2024FY26
Project in Row 311/3/20236/28/2024FY24
Project in Row 561/3/20236/28/2024 
Project in Row 571/3/20236/28/2024FY26
Project in Row 581/3/20236/28/2024FY26
Project in Row 595/24/20236/28/2024FY24
Project in Row 601/17/20236/28/2024FY26
Project in Row 611/3/20236/28/2024FY26
Project in Row 629/1/20226/28/2024FY26
Project in Row 631/23/20236/28/2024 
Project in Row 647/3/20236/28/2024 
Project in Row 6510/28/20206/28/2024FY25
  • Hi Bhatia,

    Your formula turned out fine in my Project Desktop environment.

    Try copying and pasting the formula into another custom field.

    You can also try this other similar formula (copy and paste):

    IIf([Finish]<cdate("7/1/24"),"FY24",IIf(month([Finish])>6,"FY" & right(year([Finish]),2)+1,"FY" & right(year([Finish]),2)))

    I look forward to your comments.

    Ignacio

  • Hi Bhatia,

    Your formula turned out fine in my Project Desktop environment.

    Try copying and pasting the formula into another custom field.

    You can also try this other similar formula (copy and paste):

    IIf([Finish]<cdate("7/1/24"),"FY24",IIf(month([Finish])>6,"FY" & right(year([Finish]),2)+1,"FY" & right(year([Finish]),2)))

    I look forward to your comments.

    Ignacio

    • John-project's avatar
      John-project
      Silver Contributor

      Ignacio_Martin,

      I like your approach, instead of a lengthy formula, you created an algorithm that is short, concise and will work for several years.😀

      John

    • Bhatia's avatar
      Bhatia
      Copper Contributor

      Thanks.  I checked this formula in my Lab environment and it gives correct results. THANK YOU.

      In my Production environment, re-published some projects and for those I got correct results. BUT there are some projects where the formula still shows blank value. Since I cannot find any explanation for that, I think I will ask my organization if we can involve MSFT through s support ticket.

  • John-project's avatar
    John-project
    Silver Contributor

    Bhatia,

    I can't explain why some values are showing up as blank but I can give you some insight about your formula.

     

    Remember that dates in Project are not just date values but also include the time, regardless of how a date is displayed in a view. So 6/1/24 is actually 6/1/24 8:00 AM if a start date and 6/1/24 5:00 PM if a finish date, assuming the Standard calendar. However, when the CDate function is applied to a date such as 6/1/24, it produces 6/1/24 12:00 AM. Attempting to use a "greater than or equal to" or "less than or equal to" operator in a custom field formula needs to take the time factor into account.

     

    Hope this helps.

    John

    • Bhatia's avatar
      Bhatia
      Copper Contributor

      Hi John-project:

      Thanks for suggesting the date nuance. I will keep a note of that. In this case (see above example from today) when the date is 6/30/24, I get two different FY values. 

      • John-project's avatar
        John-project
        Silver Contributor

        Bhatia,

        Sorry but I don't see any updates to your example. The latest finish date I see is 6/28/24 for several rows. Did you try Ignacio's custom field formula? It works great for me.

        John

  • Bhatia's avatar
    Bhatia
    Copper Contributor

    For some reasons I am not seeing my replies from yesterday and today. I think I will create another thread and post my reply there...

    • John-project's avatar
      John-project
      Silver Contributor

      Bhatia,

      Why start a new thread, your latest reply is here. Are you looking in the "most recent" category of postings?

      John

Resources