6 Replies Latest reply on Mar 16, 2011 8:39 AM by FlorianWiegand

# Working day calculation, value 10 if start and end date is the same

### Title

Working day calculation, value 10 if start and end date is the same

### Post

Dear All, thank you for helping me on getting a working day calculation. If the starting date is the same as the end date, the value calculated is always 10 instead of 1. Could you please help me again on this? Thank you very much Florian

• ###### 1. Re: Working day calculation, value 10 if start and end date is the same

And what is the calculation?

• ###### 2. Re: Working day calculation, value 10 if start and end date is the same

Hello Phil,

this is my calculation:

If ( not ( IsEmpty ( UAT Date  ))  ;  5 * Int ( ( UAT Date - UAT Starting Date ) / 7 ) +Middle ( "0012345501234544012343340123223491111234010012340" ; 7 * (DayOfWeek ( UAT Starting Date ) - 1 ) + DayOfWeek ( UAT Date ) ; 1)+1)

Thank you

Florian

• ###### 3. Re: Working day calculation, value 10 if start and end date is the same

Are you trying to compute the number of elapsed days from UAT Starting Date to UAT Date? Are both of these fields of type date?

If so, just use

UAT Date - UAT Starting Date

and you will get the number of days.

• ###### 4. Re: Working day calculation, value 10 if start and end date is the same

My calculation does the average working days:

"If (IsEmpty (( UAT Date ) )  ;  5 * Int ( ( Get(CurrentDate) - UAT Starting Date ) / 7 ) +Middle ( "0012345501234544012343340123223491111234010012340" ; 7 * (DayOfWeek ( UAT Starting Date ) - 1 ) + DayOfWeek ( Get(CurrentDate) ) ; 1 ) +1)"

I resolved the issue with the number 10. But the fields only get calculated when i add the date. But the field does not recalculate every day. For example the start date is 01.01.2011 and the end date is 01.03.2011. I expect the result is 3 including the start date. But when i look at the calculation one day later, the number remains 3 unless i re-enter the starting date. Then it displays 4. How can i ensure that this is done automatically every day?

Thanks

• ###### 5. Re: Working day calculation, value 10 if start and end date is the same

Hi

when a calculation gets a value from a Get( ) function, most of times it needs to be an UNSTORED calculation.

( Look at "storage options..." on the bottom right of the calc window )

• ###### 6. Re: Working day calculation, value 10 if start and end date is the same

Thank you very much, in my test scenarios this has proved to be the solution. !! :-)