If criteria is xxx, duration is zero
Dear Smartsheet community,
I have a sheet for staff to report time off.
I have this formula to calculate the net working day(s) between begin date and end date.
=NETWORKDAY([Begin Date]@row, [End Date]@row)
However there will be occasion when staff will not be taken time off. Therefore, I want to add where column Absence Name is No Leave Taken, then the result is zero.
Thank you!
Comments
-
You can use the IF function for this. The documentation on how to use it is here. https://help.smartsheet.com/function/if
Function: IF(logical_expression, value_if_true, [value_if_false])
Example: IF([Absence Name]@row = “No Leave Taken”, 0, <Insert your NETWORKDAY function>)
I am curious, however, why you have people reporting time off in the time off table when they aren’t taking time off.
Cheers
Bernard
-
Hi,
Try something like this.
=IF([Absence Name]@row = "No Leave Taken"; 0; NETWORKDAY([Begin Date]@row; [End Date]@row))
The same version but with the below changes for your and others convenience.
=IF([Absence Name]@row = "No Leave Taken", 0, NETWORKDAY([Begin Date]@row, [End Date]@row))
Depending on your country you’ll need to exchange the comma to a period and the semi-colon to a comma.
Did it work?
Hope that helps!
Have a fantastic week!
Best,
Andrée Starå
Workflow Consultant / CEO @ WORK BOLD
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.
-
Thank you, Bernard. We want staff to report the month when no time off is taken for analytic and reporting purposes.
-
Thank you, Andree!
-
Happy to help!
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
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63K Get Help
- 379 Global Discussions
- 212 Industry Talk
- 442 Announcements
- 4.6K Ideas & Feature Requests
- 140 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 449 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 304 Events
- 34 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!