View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Custom format (time) and wrapping text in a cell

Maybe this:

=INT(B1-A1)&" days"&CHAR(10)&TEXT(MOD(B1,1)-MOD(A1,1),"h")&" hours"

Format to wrap text

That results in a TEXT string so it may "complicate" matters if you need to
use the result in other math calculations.

Biff

"Phrank" wrote in message
...
Hello,

I've got a time lapse formula going where I have start date/time in
column A, end date/time in column B, and elapsed time in column C. I
also have column C set with a custom formatting of
[d "days" h "hours"], which gives me exactly what I want. For
example,

Start date/time = 12/2/2006 8:00:00 AM
End date/time = 12/04/06 10:05 PM
Elapsed time = 2 days 14 hours

As I said, this works just fine. What I would like, though, is a more
narrow column and for the text to wrap, like below

2 days
14 hours

However, it will not wrap text (I get the ######) . I've tried
setting the column width an row height to autofit, and it still will
not wrap. Any ideas? Thanks.

Frank