A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Separate AM/PM from time.



 
 
Thread Tools Display Modes
  #1  
Old June 4th, 2010, 09:18 PM posted to microsoft.public.excel.misc
cuartetto
external usenet poster
 
Posts: 4
Default Separate AM/PM from time.

In column B I have 1000 time entries with the following format. 9:30AM,
10:30PM. I would like to move the AM or Pm into a new column. I've tried
"fixed width", also tried changing the format to put a space between the time
and the AM/PM, but nothing has worked.

Any suggestions?
Don
  #2  
Old June 4th, 2010, 10:00 PM posted to microsoft.public.excel.misc
Steve
external usenet poster
 
Posts: 2,662
Default Separate AM/PM from time.

format column C to hh:mm (so no AM/PM is shown)
In C1 enter
=if(b10.5,b1-0.5,b1)
this will then only show the 12h clock even if PM
in D1 enter
=if(b10.5,"PM"."AM")
Then if you like hide column B
Copy/fill the formulas in C1 and D1 down as needed

Regards
Steve

"cuartetto" wrote:

In column B I have 1000 time entries with the following format. 9:30AM,
10:30PM. I would like to move the AM or Pm into a new column. I've tried
"fixed width", also tried changing the format to put a space between the time
and the AM/PM, but nothing has worked.

Any suggestions?
Don

  #3  
Old June 4th, 2010, 11:19 PM posted to microsoft.public.excel.misc
Dave Peterson
external usenet poster
 
Posts: 19,791
Default Separate AM/PM from time.

Are these really times or are they text?

If they're plain old text, then I'd convert them to times.

Select the range
Edit|replace:
what: AM
with: _AM (where _ represents the space character)
replace all

And once more for the PM.

Then the results should be real times. And you can use a formula like the ones
Steve suggested.

But I'd keep the data as real times -- maybe format the cell so that I see:

21:30
instead of
9:30 PM
though.



cuartetto wrote:

In column B I have 1000 time entries with the following format. 9:30AM,
10:30PM. I would like to move the AM or Pm into a new column. I've tried
"fixed width", also tried changing the format to put a space between the time
and the AM/PM, but nothing has worked.

Any suggestions?
Don


--

Dave Peterson
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:30 PM.


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