Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default How do I Change text (0130PM) into military time equivalent?

I'm trying to change times that are reported in text format (ie 0830PM
instead of 8:30PM) into military time equivalents.

Is there a straightforward way to do this?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default How do I Change text (0130PM) into military time equivalent?

Try something like this:

For a text-time in A1 (example: 0830PM)

B1: =TEXT(LEFT(A1,4)+(RIGHT(A1,2)="PM")*1200,"0000")

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"sedoc" wrote:

I'm trying to change times that are reported in text format (ie 0830PM
instead of 8:30PM) into military time equivalents.

Is there a straightforward way to do this?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default How do I Change text (0130PM) into military time equivalent?

Yes, that works.
I just then have to change all the 2400's to 1200's since 1200 is noon, and
0000 is midnight

Do you know of a way to do that?
I'm working on it myself.

Sara

"Ron Coderre" wrote:

Try something like this:

For a text-time in A1 (example: 0830PM)

B1: =TEXT(LEFT(A1,4)+(RIGHT(A1,2)="PM")*1200,"0000")

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"sedoc" wrote:

I'm trying to change times that are reported in text format (ie 0830PM
instead of 8:30PM) into military time equivalents.

Is there a straightforward way to do this?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default How do I Change text (0130PM) into military time equivalent?

Try this:

=TEXT(TIMEVALUE(LEFT(A1,2)&":00 "&RIGHT(A1,2))*2400+MID(A1,3,2),"0000")

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"sedoc" wrote:

Yes, that works.
I just then have to change all the 2400's to 1200's since 1200 is noon, and
0000 is midnight

Do you know of a way to do that?
I'm working on it myself.

Sara

"Ron Coderre" wrote:

Try something like this:

For a text-time in A1 (example: 0830PM)

B1: =TEXT(LEFT(A1,4)+(RIGHT(A1,2)="PM")*1200,"0000")

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"sedoc" wrote:

I'm trying to change times that are reported in text format (ie 0830PM
instead of 8:30PM) into military time equivalents.

Is there a straightforward way to do this?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default How do I Change text (0130PM) into military time equivalent?

EXCELLENT!!

Thanks

Sara

"Ron Coderre" wrote:

Try this:

=TEXT(TIMEVALUE(LEFT(A1,2)&":00 "&RIGHT(A1,2))*2400+MID(A1,3,2),"0000")

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"sedoc" wrote:

Yes, that works.
I just then have to change all the 2400's to 1200's since 1200 is noon, and
0000 is midnight

Do you know of a way to do that?
I'm working on it myself.

Sara

"Ron Coderre" wrote:

Try something like this:

For a text-time in A1 (example: 0830PM)

B1: =TEXT(LEFT(A1,4)+(RIGHT(A1,2)="PM")*1200,"0000")

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"sedoc" wrote:

I'm trying to change times that are reported in text format (ie 0830PM
instead of 8:30PM) into military time equivalents.

Is there a straightforward way to do this?



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default How do I Change text (0130PM) into military time equivalent?

This also works:

=TEXT(LEFT(A1,2)&":"&MID(A1,3,2)&" "&RIGHT(A1,2),"hhmm")

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"sedoc" wrote:

Yes, that works.
I just then have to change all the 2400's to 1200's since 1200 is noon, and
0000 is midnight

Do you know of a way to do that?
I'm working on it myself.

Sara

"Ron Coderre" wrote:

Try something like this:

For a text-time in A1 (example: 0830PM)

B1: =TEXT(LEFT(A1,4)+(RIGHT(A1,2)="PM")*1200,"0000")

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"sedoc" wrote:

I'm trying to change times that are reported in text format (ie 0830PM
instead of 8:30PM) into military time equivalents.

Is there a straightforward way to do this?

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
Can you change the Text Import Wizard column options SteveB Excel Discussion (Misc queries) 3 July 28th 06 04:00 PM
how i change thai text to english text Mani Excel Worksheet Functions 1 June 8th 06 03:10 PM
Change number format from text to number? Scot New Users to Excel 2 December 1st 05 05:15 PM
Formulas dealing with text data Bagia Excel Worksheet Functions 6 June 20th 05 10:29 PM
Time Stamp without change AntonyY Excel Discussion (Misc queries) 3 November 26th 04 10:13 AM


All times are GMT +1. The time now is 12:45 PM.

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"