This small User Defined Function (UDF) should solve your problems. (it will also handle seconds):
User Defined Functions (UDFs) are very easy to install and use:
1. ALT-F11 brings up the VBE window
2. ALT-I ALT-M opens a fresh module
3. paste the stuff in and close the VBE window
If you save the workbook, the UDF will be saved with it.
To remove the UDF:
1. bring up the VBE window as above
2. clear the code out
3. close the VBE window
To use the UDF from Excel:
=UnTiFo(A1)
To learn more about macros in general, see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
or
http://www.cpearson.com/excel/Writin...ionsInVBA.aspx
for specifics on UDFs
Here ae some inputs/outputs:
4d 15h 10m 4.631944444
4d 15h 10m 4.631944444
4d 16h 28m 4.686111111
12m 0.008333333
5m 0.003472222
1h 40m 0.069444444
1h 40m 0.069444444
58s 0.000671296
58s 0.000671296
22h 38m 0.943055556
59s 0.000682870
4d 23h 32m 4.980555556
5m 0.003472222
6d 11h 53m 6.495138889
5m 0.003472222
22d 9h 51m 22.410416667
22d 9h 51m 22.410416667
22d 9h 51m 22.410416667
22d 9h 51m 22.410416667
22d 9h 51m 22.410416667
22d 9h 51m 22.410416667
22d 9h 51m 22.410416667
6m 0.004166667
6m 0.004166667
36d 7h 51m 36.327083333
36d 7h 51m 36.327083333
117d 12h 15m 117.510416667
12s 0.000138889
0m 86400s 1.000000000
Bookmarks