In this post, we will explain How to convert Number to time in SharePoint Calculated Field
![Convert Number To Time in SharePoint Calculated Field Convert Number To Time in SharePoint Calculated Field](https://mohamedelkassas.files.wordpress.com/2018/10/convert-numbers-to-time-in-sharepoint-calculated-field.png?resize=408%2C251)
You might also like to read Supported and Unsupported Columns In SharePoint Calculated Column Formula
I have a SharePoint list, one of its columns is a number column that holds a duration value with minutes.
![Convert Number To Time in SharePoint Calculated Field Convert minutes To Time in SharePoint Calculated Field](https://mohamedelkassas.files.wordpress.com/2018/10/convert-number-field-to-time-field-in-sharepoint-calculated-field.png?resize=306%2C251)
I would like to display the number of minutes as a Time Format (hh:mm) in the SharePoint Calculated field as shown below:
![Convert Number To Time in SharePoint Calculated Field Convert Number to Duration SharePoint Calculated Field](https://mohamedelkassas.files.wordpress.com/2018/10/convert-numbers-to-time-in-sharepoint-calculated-field.png?resize=408%2C251)
in this section, we’ll show how to display a decimal as a time in SharePoint calculated column by doing the below steps:
- Create a SharePoint List.
- Add a new number column for the minute’s value.
- Create a calculated field to convert the minute’s value to time format (hh:mm).
Steps
- Open SharePoint site.
- Click on the setting gear icon, click on “Add a new App”.
![Convert Number To Time in SharePoint Calculated Field Add an app in SharePoint](https://i0.wp.com/spgeeks.devoworx.com/wp-content/uploads/2016/05/add-an-app.png?resize=182%2C314&ssl=1)
- Create a custom list.
![Convert Number To Time in SharePoint Calculated Field Convert Number To Time in SharePoint Calculated Field](https://i0.wp.com/spgeeks.devoworx.com/wp-content/uploads/2016/03/customlist.png?resize=361%2C417&ssl=1)
In the newly created SharePoint List, we’ll create a new column for “Minutes” with Number datatype by doing the following:
Steps
- Open List Settings.
![Convert Number To Time in SharePoint Calculated Field List Settings](https://i0.wp.com/spgeeks.devoworx.com/wp-content/uploads/2016/08/list-settings.gif?resize=512%2C311&ssl=1)
- Scroll down to columns, click on add a new column.
- The field data type must be a Number.
- The number of decimal places should be 0.
![Convert Number To Time in SharePoint Calculated Field Show Minutes as a time format in SharePoint](https://mohamedelkassas.files.wordpress.com/2018/10/show-minutes-as-a-time-format-in-sharepoint.png?resize=506%2C537)
- Go to List Settings.
- Add a new Column.
- Set the column name as you prefer.
- Set the column type to Calculated (calculation based on other columns).
- Download The SharePoint Calculated Field Time Format Formula.
- Or download the List Template with the time formula at Convert Minutes to Time format in SharePoint Calculated Field.
- Add it in the formula section.
![Convert Number To Time in SharePoint Calculated Field Create a Time Format SharePoint Calculated Field Formula](https://mohamedelkassas.files.wordpress.com/2018/10/time-format-sharepoint-calculated-field-formula.png?resize=493%2C303)
- Set the data type returned from this formula to Number with 0 number of decimal places.
![Convert Number To Time in SharePoint Calculated Field Time Format SharePoint Calculated Field setting](https://mohamedelkassas.files.wordpress.com/2018/10/time-format-sharepoint-calculated-field-setting.png?resize=282%2C210)
- Save the formula.
- Add or edit a new item in your list.
- The newly calculated field should calculate the time as an hour and minutes based on the assigned number in the minute’s column.
![Convert Number To Time in SharePoint Calculated Field Convert Minutes to Time in SharePoint Calculated Column](https://mohamedelkassas.files.wordpress.com/2018/10/convert-numbers-to-time-in-sharepoint-calculated-field.png?resize=408%2C251)
Also, you can use any online converter tool to make sure that the calculation has been done successfully.
![Convert Number To Time in SharePoint Calculated Field Test Number to time in SharePoint](https://mohamedelkassas.files.wordpress.com/2018/10/convert-number-field-to-time-field-in-sharepoint-calculated-field.gif?resize=503%2C242)
In this section, we’ll explain in details the formula used to Convert Number To Time in SharePoint Calculated Field.
Hour Calculation
we have calculated the hours by dividing the number of minutes by 60 (Minutes / 60) then we used INT function to round down the result to the nearest integer.
Minute Calculation
we have also calculated the Minutes by getting the fraction result of (Minutes / 60) then multiply this fraction to 60.
Note: Use ROUND(number,num_digits) function to round a specific number to a specified number of digits, when the number of digits is equal to zero so it round to the nearest integer as I did in my formula.
Conclusion
In conclusion, we have learned How to Convert Number To Time in SharePoint Calculated Field, also we have explored the use of
- INT function in the SharePoint calculated field.
- ROUND function in the SharePoint calculated field.
Download
You can download the list template with the time formula from GitHub at Convert Minutes to Time format in SharePoint Calculated Field, also Please, don’t forget to Follow Me to get the latest updates.
Applies To
- SharePoint Online.
- SharePoint 2019.
- SharePoint 2016.
- SharePoint 2013.
- SharePoint 2010.
You might also like to read
- Using Lookup Field in Calculated Column SharePoint.
- Use SharePoint ID Field in Calculated Column.
- SharePoint Auto Populate Column based on another Column.
- Auto Serial Number in SharePoint New Form using JSOM
Have a Question?
If you have any related questions, please don’t hesitate to ask it at deBUG.to Community.
Pingback: Date Conditional Formatting In SharePoint 2019 | SPGeeks
I was very happy to uncover this web site. I wanted to thank you for ones time just for this fantastic read!! I definitely enjoyed every part of it and I have you book marked to look at new information on your blog.
Nice article..!
Thanks! This worked out well for me, but I would like to show Seconds to hh:mm:ss. Is that possible?
same here, my initial Sharepoint duration data was “Seconds”, I changed “Minutes” to “Seconds” in the code, and it worked, the Duration column now shows mm:ss (example: 81 seconds now show as “01:21”), but I’d also like to show hh:mm:ss and I don’t know how to add the hour piece. Thanks
Awesome article ❤️ love it
Welcome 🙂