Date Formating

G

Guest

Hi

I merge 2 date and time cells with the formula = A5 &"" & B5 where A5 is
9/12/2007 and B5 is 16:00. The result I get is 393370.666666666666667. I
tried to format as mm/dd/yyyy hh:mm or any other date and time format none
worked.

Does anyone know how can I get the format I want.

Thanks in advance for your help.

Orquidea
 
D

Dave Peterson

If you want text:
=text(a5,"mm/dd/yyyy") & " " & text(b5,"hh:mm:ss")

if you really want a number:
=a5+b5
and give it a custom format of:
mm/dd/yyyy hh:mm:ss

(or the format you like)

The problem is that 9/12/2007 is 39337 days past a starting date (Dec 31, 1899)

And b5 is 0.6666666667 (time is just a fraction of a day = 16/24)

When you used this to concatenate the strings:
= A5 &"" & B5
You ended up with the leading 0 for the hours appended to the whole number
portion.
 

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

Top