Converting time figures into 24-hour format & sorting them...

C

Clint Johnson

I've a sheet with - among others - two columns containing:

Column A. Time figures (03:27) and
Column B. The "AM" or "PM" designator (text)

I want to be able to sort the times in chronological order, by using the
24-hour time format.

How can I tell Excel to look at the contents of the two cells in these
columns for each of the 1200+ rows in my sheet, and convert any "PM" times
to the 24-hour format?

For example, for 03:27 PM, I want the "03:27" to read "15:27".

Or is there another way to accomplish this?

Thanks!
 
F

Fred Smith

First, you can sort the times as they exist. Sort Column B first, then
Column A. That will put all the AMs first, followed by all the PMs.

Second, to convert column A to an excel time, use =--A1 and copy down. To
adjust for am/pm, try:

=--A1+if(b1="pm","12:00:00",0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top