Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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


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.