# IF Function to return Yes or No depending on difference between two dates.

Options

Hello,

I have two date columns; [First Date of Absence] and [Start Date].

I am trying to write a formula that returns "YES" if the difference between [First Date of Absence] and [Start Date] is less than or equal to 182 and returns "NO" if the difference between [First Date of Absence] and [Start Date] is more than than 182.

I have tried different variations but can't get it to work. Any help would be really appreciated.

Tags:

• ✭✭✭✭✭✭
Options

I hope you're well and safe!

Try something like this.

```=IF(OR([First Date of Absence]@row = "", [Start Date]@row = ""), "",
IF(NETDAYS([First Date of Absence]@row, [Start Date]@row) <= 182, "NO", "YES"))
```

Did that work/help?

I hope that helps!

Be safe and have a fantastic weekend!

Best,

Andrée Starå | Workflow Consultant / CEO @ WORK BOLD

Did my post(s) help or answer your question or solve your problem? Please support the Community by marking it Insightful/Vote Up or/and as the accepted answer. It will make it easier for others to find a solution or help to answer!

SMARTSHEET EXPERT CONSULTANT & PARTNER

Andrée Starå | Workflow Consultant / CEO @ WORK BOLD

W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35

Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.

• Options

Unfortunately no, that formula returns "NO" regardless of the dates.

• ✭✭✭✭✭✭
Options

Strange!

It works for me.

I'd be happy to take a quick look.

Can you maybe share the sheet(s)/copies of the sheet(s)? (Delete/replace any confidential/sensitive information before sharing) That would make it easier to help. (share too, andree@workbold.com)

SMARTSHEET EXPERT CONSULTANT & PARTNER

Andrée Starå | Workflow Consultant / CEO @ WORK BOLD

W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35

Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.

• ✭✭✭✭✭
Options

Hi Andree - I just wrote one like this but was attempting to string it as I have different values to return if it's over either 30 days, (return "60 Days) 60 days (Return 90 Days) or 90 days (Return "Peer)

Not getting it to work - just unparseable. Thoughts?

Thanks !

• ✭✭✭✭✭✭
Options

I think I answered you in another thread with the solution. (pasted below)

I hope you're well and safe!

Try something like this. (you had one "-" too many before the 90-Day part)

```=
IF([30-day process begin]@row = 1, "30-Day",
IF([60-day process begin]@row = 1, "60-Day",
IF([90-day process begin]@row = 1, "90-Day", "-")))
```

Did that work/help?

I hope that helps!

Be safe and have a fantastic week!

Best,

Andrée Starå | Workflow Consultant / CEO @ WORK BOLD

Did my post(s) help or answer your question or solve your problem? Please support the Community by marking it Insightful/Vote Up or/and as the accepted answer. It will make it easier for others to find a solution or help to answer!

SMARTSHEET EXPERT CONSULTANT & PARTNER

Andrée Starå | Workflow Consultant / CEO @ WORK BOLD

W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35

Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!