rounding negative values | Community
Skip to main content
KristenS_WF
New Participant
February 20, 2025
Solved

rounding negative values

  • February 20, 2025
  • 1 reply
  • 415 views

I need help with a calculation, and I'm sure I'm missing something obvious.

I have a calculated field to determine the difference between a custom date field and the project planned completion date: 

WEEKDAYDIFF({plannedCompletionDate}, (ADDWEEKDAYS({DE:First Offer Date},-15))).

I included the field in a report and added conditional formatting for it (>=0 [Green]; >=-5 [Yellow]; <-5 [Red]).  This works fine.

Then I wanted to try to account for holiday exceptions in our schedule.  I added a calculated column in the report (I wanted to try it out here before changing my calculated field):
 
valueexpression=ROUND(WORKMINUTESDIFF({plannedCompletionDate}, (ADDWEEKDAYS({DE:First Offer Date},-15)))/480).
 
The underlying calculation works; however, rounding the calculation results in positive values.  How can I round the result and still maintain any negative values?
 

 

Thanks.

Best answer by skyehansen

Unless I miss my guess, "workminutesdiff" will never give you a negative result. If you want to use it, my guess is that you should find some way to artificially place one outside of the workminutes part of the equation (i.e. if first offer date minus 15 is > planned completion date, "-", then the workminutes calculation).

1 reply

skyehansen
skyehansenAccepted solution
New Participant
February 20, 2025

Unless I miss my guess, "workminutesdiff" will never give you a negative result. If you want to use it, my guess is that you should find some way to artificially place one outside of the workminutes part of the equation (i.e. if first offer date minus 15 is > planned completion date, "-", then the workminutes calculation).

KristenS_WF
New Participant
February 20, 2025

Ah... good point (didn't think about that).

Pity the WEEKDAYDIFF function doesn't incorporate the default schedule (with exceptions) like WORKMINUTESDIFF does.

Thanks!