How do I convert duration text strings to numbers in minutes?
I have a column (of known length) of duration text strings that may contain strings that are not durations. I want to convert just the duration text strings to numbers in minutes: A 14h 58m 30s 22h 28m 1d 7h 27m — Header 1d 20h 2m I extract day, hour, minute, and second numbers to an array, check if any contains a match and if so, sum the minutes: =let(ind_last_row,60 ,time,offset(A1,0,0,ind_last_row,1) ,time_2_arr,lambda(time,REGEXEXTRACT(time,"(\d*d)?\s*(\d*h)?\s*(\d*m)?\s*(\d*s)?")) ,time_arr_2_min,lambda(arr,sumproduct(arrayformula(regexreplace(arr,"[dhms]","")),{1440,60,1,1/60})) ,nomatch
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.