# Calculating # of past or upcoming days from target date

✭✭✭✭

I am trying to write a formula that calculates the number of days from a target finish date. I am using the =NETDAYS function but it is only calculating the days as a positive number. How can I write the formula so that it counts down days from an upcoming target date and also displays (-)days past that target date?

• ✭✭✭✭✭✭
```=IF([Finish Date] @row > TODAY(), NETWORKDAYS(TODAY(), [Finish Date] @row), -1 * NETWORKDAYS([Finish Date] @row, TODAY()))
```

You have spaces between [Finish Date] and @row. It should be [Finish Date]@row, as shown here:

=IF([Finish Date]@row > TODAY(), NETWORKDAYS(TODAY(), [Finish Date]@row), -1 * NETWORKDAYS([Finish Date]@row, TODAY()))

Regards,

Jeff Reisman

If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!

• ✭✭✭✭✭✭

Hi @Gabe Tarin

Hope you are fine, please try the following formula:

```=IF([target finish date]@row > TODAY(), NETWORKDAYS(TODAY(), [target finish date]@row),
-1 * NETWORKDAYS([target finish date]@row, TODAY()))
```

the following screenshot shows the result:

bassam.khalil2009@gmail.com

☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"

• ✭✭✭✭

Thanks Bassam,

I input the formula like this: =IF([Finish Date] @row > TODAY(), NETWORKDAYS(TODAY(), [Finish Date] @row), -1 * NETWORKDAYS([Finish Date] @row, TODAY())) but I am getting a syntax error. Any ideas?

• ✭✭✭✭✭✭
```=IF([Finish Date] @row > TODAY(), NETWORKDAYS(TODAY(), [Finish Date] @row), -1 * NETWORKDAYS([Finish Date] @row, TODAY()))
```

You have spaces between [Finish Date] and @row. It should be [Finish Date]@row, as shown here:

=IF([Finish Date]@row > TODAY(), NETWORKDAYS(TODAY(), [Finish Date]@row), -1 * NETWORKDAYS([Finish Date]@row, TODAY()))

Regards,

Jeff Reisman

If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!

• ✭✭✭✭

Thank you @Jeff Reisman !

• ✭✭✭✭✭✭

My pleasure, but it was @Bassam Khalil who did the heavy lifting here!

Regards,

Jeff Reisman

If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!