![]() |
Convert range values to correct "hh:mm:ss" format.
When exporting data from another application as an excel worksheet I
end up with it in the following format. Stat 1 Stat 2 Person1 01:16:00 01:09:25 Person2 :18 :49:12 I want to macro that will convert all the data in the range to "hh:mm:ss". Just applying data type cell formatting as hh:mm:ss does not fix the values for Person2 and seems excel just treats it as text. What is the most efficient way to do a check of all the data and then fix the value of the data that is not in the correct format to hh:mm:ss. Thanks. |
Convert range values to correct "hh:mm:ss" format.
|
Convert range values to correct "hh:mm:ss" format.
Thanks Dave,
It work almost fine, just that I should have clarified that the data Person1, Stat2 01:09:25 when taken to excel is actually in the correct format (hh:mm:ss) and does not need to be converted to anything, it just needs to be left alone. How can I tweak the formula to include this possibility. thanks. |
Convert range values to correct "hh:mm:ss" format.
You'd have to use a different formula in column in E1.
=IF(ISNUMBER(d1),d1,IF((LEN(d1)-LEN(SUBSTITUTE(d1,":","")))=1, --("0"&d1)/60,--("0"&d1))) But I'm not sure what :49:12 meant. So that last portion is still a guess. wrote: Thanks Dave, It work almost fine, just that I should have clarified that the data Person1, Stat2 01:09:25 when taken to excel is actually in the correct format (hh:mm:ss) and does not need to be converted to anything, it just needs to be left alone. How can I tweak the formula to include this possibility. thanks. -- Dave Peterson |
All times are GMT +1. The time now is 08:04 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com