cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
TheSlawekG
Level: Powered On

Display 0 if one value is empty

Hi,

 

I have an SP list as below:hours.PNG

 

My current formula for the column "Hours per Shift" is =TEXT([Time Out]-[Time In],"h"); it is being calculated fine when I have two dates. How I could display 0 if the "Time Out" column is empty so the calculation would be done only if two columns have a date in them?

 

Thank you.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Display 0 if one value is empty

 

Hi @TheSlawekG ,

 

Please try this formula:

=IF([Time Out]="","0",TEXT([Time Out]-[Time In],"h"))

75.PNG

For more details on Calculated Field Formulas, please check this online doc:

https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/bb862071(v=offic...

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
Super User
Super User

Re: Display 0 if one value is empty

Just use an if statement looking to see if whichever column you choose is blank '0' otherwise put your calculation.

Community Support Team
Community Support Team

Re: Display 0 if one value is empty

 

Hi @TheSlawekG ,

 

Please try this formula:

=IF([Time Out]="","0",TEXT([Time Out]-[Time In],"h"))

75.PNG

For more details on Calculated Field Formulas, please check this online doc:

https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/bb862071(v=offic...

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
TheSlawekG
Level: Powered On

Re: Display 0 if one value is empty

Thank you!

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 297 members 3,970 guests
Please welcome our newest community members: