Thanks to both Jim and Ron. Question for Ron: I have a spreadsheet with
several time columns. If I want to sort manually through the sort feature do
I still use the same formula?
Thanks again in advance
"Ron Rosenfeld" wrote:
On Wed, 21 Sep 2005 14:16:03 -0700, "Howdy"
wrote:
Hope it's OK to ask this he I am trying to sort a column of times 423PM,
958AM, 1034AM, 1245PM, etc.) but the sort puts the column this way - 1034AM,
1245PM, 423PM, 958AM. Why won't it put 958AM first?
Thanks in advance
Because what you think are times are really text strings.
When sorting text 1 comes before 2 comes before ... 9.
If you want Excel to sort them as times, you have to enter them as times (or
convert them to times).
To convert them to times, you can use this formula:
=TIMEVALUE(INT(LEFT(A1,LEN(A1)-2)/100)&":"&
MOD(LEFT(A1,LEN(A1)-2),100)&" "&RIGHT(A1,2))
After doing the conversions:
Edit/Copy
Edit/Paste Special Values
Then they will sort in time order.
If you are entering the times, then to enter 423PM you must enter it as:
4:23 PM
--ron
|