cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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
Highlighted
Community Support
Community Support

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.

View solution in original post

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.

Highlighted
Community Support
Community Support

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.

View solution in original post

Highlighted
Helper I
Helper I

Re: Display 0 if one value is empty

Thank you!

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Users online (7,087)