Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Clint Johnson
 
Posts: n/a
Default Converting time figures into 24-hour format & sorting them...

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!

----------------------
Clint Johnson
Homewood, IL


  #2   Report Post  
Fred Smith
 
Posts: n/a
Default

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)

--
Regards,
Fred
Please reply to newsgroup, not e-mail


"Clint Johnson" wrote in message
...
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!

----------------------
Clint Johnson
Homewood, IL




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Round Time with Conditions KimLL Charts and Charting in Excel 1 February 15th 05 04:23 PM
Custom Time Format doesn't work for me chuck Excel Discussion (Misc queries) 1 February 13th 05 04:12 AM
I cannot get time format to display in a drop-down list Mighty Mike Excel Discussion (Misc queries) 0 February 1st 05 09:47 PM
entering numbers to display a time format Ian Williams/Eazygig Excel Discussion (Misc queries) 1 January 10th 05 11:57 AM
Can't stop time duration [hh]:mm:ss converting to time of day Jack Cutrone Excel Discussion (Misc queries) 7 December 27th 04 11:23 PM


All times are GMT +1. The time now is 10:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"