I need to add space to convert DATE to TIME format

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

A2: 4/03 6:36pm
B2: FORMULA HERE

In B2, I need to convert A2 to 4/3/07 6:36 pm - putting a space between the
time and PM.

Thanks!
 
One way

=LEFT(A2,FIND(" ",A2))+SUBSTITUTE(MID(A2,FIND(" ",A2)+1,255),"pm"," pm")

format custom as mm/dd/yy hh:mm AM/PM
 
Do you mean you want B2 to have the same information as A2, with a
different format? If so, put =A2 in B2. Select cell B2, then Format
from the menubar, then Cells. On the Number tab, select the Custom
category. In the Type box, type in
m/d/yy hh:mm AM/PM
(leaving a space before AM/PM). I hope I understood your question
correctly. James
 
yes. Got it.

Thanks all!
--
Texas Wannano


Zone said:
Do you mean you want B2 to have the same information as A2, with a
different format? If so, put =A2 in B2. Select cell B2, then Format
from the menubar, then Cells. On the Number tab, select the Custom
category. In the Type box, type in
m/d/yy hh:mm AM/PM
(leaving a space before AM/PM). I hope I understood your question
correctly. James
 
That worked. Thanks!
--
Texas Wannano


Peo Sjoblom said:
One way

=LEFT(A2,FIND(" ",A2))+SUBSTITUTE(MID(A2,FIND(" ",A2)+1,255),"pm"," pm")

format custom as mm/dd/yy hh:mm AM/PM
 
I need to incorporate an OR function...the suffix can be either AM or
PM...the formula did not work where there was an am in the cell. There are
too many line to do it individually.

Advice please.

Thank you!
 
Sure

=LEFT(A2,FIND(" ",A2))+SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("
",A2)+1,255),"pm"," pm"),"am"," am")

should take care of am as well
 
THANKS A MILLION!!!
--
Texas Wannano


Peo Sjoblom said:
Sure

=LEFT(A2,FIND(" ",A2))+SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("
",A2)+1,255),"pm"," pm"),"am"," am")

should take care of am as well
 

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

Back
Top