Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have text in one column that has times formatted as "1230 pm" and need to convert it to time.

I managed to convert the "am" data but didn't get it to work with the "pm" data.

share|improve this question

1 Answer 1

If the text is in A1, then you can format a cell for the time format you want, and use this formula:

=TIMEVALUE(LEFT(A1,LEN(A1)-5) & ":" & MID(A1,LEN(A1)-4,2) & " " & RIGHT(A1,2))

Make sure you format the cell as time format otherwise you'll get a funky decimal. Also, this only works if the space is between the number and the am/pm.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.