Forum Discussion
astokes8
Mar 23, 2022Copper Contributor
Changing data to hours
I have data that has been entered in days and hours; i.e. 1d 16h. Is there a way to use a formula to change this data to hours; i.e. 40h?
Starrysky1988
Mar 23, 2022Iron Contributor
Here it is. You may change the cell reference A1 accordingly.
=(LEFT(A1,SEARCH("d",A1)-1)+TIMEVALUE(SUBSTITUTE(RIGHT(LOWER(A1),LEN(A1)-SEARCH(" ",A1)),"h",":0")))*24&"h"
=(LEFT(A1,SEARCH("d",A1)-1)+TIMEVALUE(SUBSTITUTE(RIGHT(LOWER(A1),LEN(A1)-SEARCH(" ",A1)),"h",":0")))*24&"h"
- astokes8Mar 23, 2022Copper ContributorThanks. I just tried that formula with one cel and it’s just showing #VALUE! Is there something else I need to do? The cell I tried it on reads “2d 1h”
- Starrysky1988Mar 23, 2022Iron Contributor
It works.
=(LEFT(A1,SEARCH("d",A1)-1)+TIMEVALUE(SUBSTITUTE(RIGHT(LOWER(A1),LEN(A1)-SEARCH(" ",A1)),"h",":0")))*24&"h"
- astokes8Mar 25, 2022Copper ContributorThanks so much!