Question : Date-Time format which includes a line skip?

I have a bunch of time stamps like this: 7/19/2010  5:30:00 PM and 7/20/2010  5:20:00 PM, with which I need to calculate the duration. I can subtract them and I get the correct number (0.9931).  I have them formatted "m/d/yyyy" because if I format them "m/d/yyyy h:mm", the columns need to be wider than I would like in order to see the resulting number.

I would like to insert a line skip between the date and the time, thereby allowing me to see the time while keeping a narrower column, but when I do that they are no longer computable.

We have another customer who gives us computable date-time stamps, in which wrap text alignment creates the line skip. Curiously their numbers are formatted "[$-409]d-mmm;@" and yet look like this: 6/29/2010 05:34:00. Notice there is only one space between the date and the time. In my experience Excel 2003 always creates two spaces.  As soon as I add the second space to one of theirs, then it displays as you would expect: "1-Jul".

Is it possible to make the line skip part of the formatting? And would that do it?

Please take a look at the attached workbook.

Puzzled,
John





Attachments:
 
TimeStampFormatting
 

Answer : Date-Time format which includes a line skip?

John,

their "time stamp" with a line break is treated as text. That's why it wraps in the cell and that's why it results in the calculation error.

I am on a NZ date setting, with the default date format in the order mm/dd/yyyy and when I open the file, your dates display as 30/06/2010 whereas "their" dates show as 6/30/2010, which tells me that they are not real dates, otherwise Excel would have swapped the day and month around.

I don't think you can format a date/time combination to include a line break, but you can create a cell for display purposes only

=TEXT(INT(C3),"mm/dd/yyyy")&CHAR(10)&TEXT(MOD(C3,1),"hh:mm")

You can perform your calculation on the real time stamp data. Hide columns you don't need.

See attached

cheers, teylyn
Random Solutions  
 
programming4us programming4us