I have decimal values followed by a letter to indicate the time unit (hours/minutes) values like the following:

- 60m
- 1.5h
- 15m
- 20h

How can I convert these to a numeric value of minutes or time value? So in other words the above cells would become:

- 60
- 90
- 15
- 1200

I have found the following formula from here: https://www.reddit.com/r/excel/comments/o0bxvl/formula_to_convert_time_in_text_like_2h_15m_or/

```
=IF(ISERR(FIND(" ",B2)), LEFT(B2,FIND("m",B2)-1)/(60*24), LEFT(B2,FIND("h",B2)-1)/24+MID(B2,FIND(" ",B2)+1,FIND("m",B2)-FIND(" ",B2)-1)/(24*60))
```

However that does not seem to work in my case - I assume because I have values like `1h`

instead of `1h 0m`

...

To solve this I have been trying to use the `REGEX`

function but I'm giving up as it's taking too long to figure this out, if it's helpful to anyone in future I was partially trying a regex/function as: `=(REGEX(E2,"(\d+)m|.*","$1",""))`