Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Working with SLA times in Google Sheets

Brendan Tipney July 23, 2021

I am having an issue working with SLA values when brought into Sheets. The problem is that the values come in as 6h 21m. To make it harder, they may come in as just 21m if no hour component is present, or -21m if the SLA has expired. Is there any way to get this value in a time format that is easier to work with in sheets?

3 answers

1 accepted

0 votes
Answer accepted
Brendan Tipney July 26, 2021

Yes, in the end I was able to get the data into Hour format using some Regular expressions.

 

The below expression was able to pull out the hours and convert minutes to partial hours. It also sets cells to blank if they do not contain data. Just change K3 in the code to the cell you are looking to convert.

 



=IF(ISBLANK(K3),,IF(REGEXMATCH(K3,"[h]"),IF(REGEXMATCH(K3,"[m]"),(REGEXEXTRACT(K3,"(\d+)h") + REGEXEXTRACT(K3,"(\d+)m")/60),REGEXEXTRACT(K3,"(\d+)h")),REGEXEXTRACT(K3,"(\d+)m")/60))
Maksym Yaremko October 12, 2021

Error(

1 vote
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 26, 2021

Hi,

You could create a in your sheet to transform the value in second or minute. You may need to separate your SLA in multiple column (hour, minute, second).

0 votes
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 5, 2024

Hello All,

I was just playing around with a similar function and found a solution to this one.  Sharing the solution in case anyone else is looking to do something similar.

Assuming Cell A2 is the cell that contains the Jira SLA value using the following formula did what I needed:

=((iferror(left(A2,search("h",A2)-1),0))*3600) + ((iferror(iferror(MID(A2, SEARCH("h", A2)+1, SEARCH("m", A2) - SEARCH("h", A2) -1),left(A2,search("m",A2)-1)),0))*60)

This will take any combination of Positive or negative values where there is an hour and minute combination OR just the hour OR Just the Minute (for the edge case where a SLA was exported with exactly an hour or only minutes remaining) 

so if it is "10h 1m" or "1h 10m" or "1h" or "1m" or "-999999999h 2m" etc.... and converts it into seconds which is a much easier time format to use for later conversions in Spreadsheet applications.

I know this is an older post but Hope this reaches you or anyone who runs across this in the future.

Regards,
Earl

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events