I have text in the format "1w1d1h1m" in an Excel workbook.
Is there any way that Excel can convert this time format into number of hours?
I have text in the format "1w1d1h1m" in an Excel workbook. Is there any way that Excel can convert this time format into number of hours? 


Assuming that weeks will be any number of digits, days 1 digit (0 to 6) and hours and minutes up to 2 digits this formula should work for any combination of w, d, h, m being present



A formula for this could be quite lengthy (as @chuff has just shown!) but if it is guaranteed that letters will never be immediately adjacent then I'd suggest replacing w by m, d by m, and h by m then Text to Columns using m as the delimiter and finish off with a formula 


Assuming that the time value you are working with is a string, the following formula should do it:
If any of the elements of the time string are missing, then that time category is counted as 0. 

