Thread: Text to Numbers
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default Text to Numbers

My approach would be to split the column into multiple columns using Data/
Text to Columns with comma and space as separators. This would leave your
numbers in the odd numbered columns, followed by the units in the even
numbered columns.
You could then use something like
=A1*IF(LEFT(B1,3)="day",24*60*60,IF(LEFT(B1,4)="ho ur",3600,IF(LEFT(B1,6)="minute",60,IF(LEFT(B1,6)=" second",1,IF(AND(A1="",B1=""),0,"error"))))) for the first column, and add similar values for 3rd, 5th, and however manyother columns you need.--David Biddulph"clk" wrote in ... Hi everyone. I have a column of data imported into excel that has text and numbers. Such as 3 hours, 57 minutes, 43 seconds. It might also just have 39 seconds or 1 day, 4 hours, 45 minutes. It would look like this: A1 3 hours, 57 minutes, 43 seconds 39 seconds 1 day, 4 hours, 45 minutes I need to take this column and convert each entry to seconds. f anyone can think of a way to do this it would be greatly appreciated.