# Thread: Help with IF statement (2000 sp3)

1. ## Help with IF statement (2000 sp3)

All,
I have the following calculation. It works fine, except that the result does not take in to account a reversed date situation.

The formula calculates the number of work days between two dates. I would like to display the results when the condition is less than zero.

=IF(NETWORKDAYS(G2,X2,Calendar!\$E\$1:\$E\$207)<0,"",1 +NETWORKDAYS(G2,X2,Calendar!\$E\$1:\$E\$207))

Any Ideas,

2. ## Re: Help with IF statement (2000 sp3)

If you always want a positive result:

=1+ABS(NETWORKDAYS(G2,X2,Calendar!\$E\$1:\$E\$207))

If you want negative results to be displayed:

=IF(NETWORKDAYS(G2,X2,Calendar!\$E\$1:\$E\$207)<0,-1+NETWORKDAYS(G2,X2,Calendar!\$E\$1:\$E\$207),1+NETWOR KDAYS(G2,X2,Calendar!\$E\$1:\$E\$207))

3. ## Re: Help with IF statement (2000 sp3)

Hans,
The second version of the formula is what I am looking for, however I think I need one more IF statement.
=IF(NETWORKDAYS(G2,X2,Calendar!\$E\$1:\$E\$207)<0,-1+NETWORKDAYS(G2,X2,Calendar!\$E\$1:\$E\$207),1+NETWOR KDAYS(G2,X2,Calendar!\$E\$1:\$E\$207))

The below is what I get:

Date ARA Work Complete ARA Cycle Time (Work days)
(27,186)
(27,266)
6-May-2005 4

If the Complete date is blank, then do not calculate the number of days.
If the complete date is populated, then calculate.
If the complete date is populated, and less than the received date (column G for this calc) then show the negitive days.

Hope this is clear.

4. ## Re: Help with IF statement (2000 sp3)

Try
<code>
=IF(X2="","",IF(NETWORKDAYS(G2,X2,Calendar!\$E\$1:\$E \$207)<0,-1+NETWORKDAYS(G2,X2,Calendar!\$E\$1:\$E\$207),1+NETWOR KDAYS(G2,X2,Calendar!\$E\$1:\$E\$207)))
</code>
I have assumed that the complete date is in X2.

5. ## Re: Help with IF statement (2000 sp3)

Hans,
This did the trick! Thanks again,,,,,,