Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 153
Default Custom format (time) and wrapping text in a cell

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 196
Default Custom format (time) and wrapping text in a cell

Frank

You can do it all within the TEXT function (altho Biff's comments re
text still stand (obviously)) - maybe you should hide the column
containing the numeric and place the text formula in the immediately
adjacent column? That way you wouldn't impact any existing formulas:

=TEXT(B1-A1,"d \d\a\y\s" & CHAR(10) & "h \h\o\u\r\s")

and remember to format the cell for wrapped text.

Richard



T. Valko wrote:

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


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 153
Default Custom format (time) and wrapping text in a cell

Thanks Biff and Richard,

Yes, I need the end result in further calculations, so the text route
won't work. Thank you for your input anyway, I appreciate that.

Frank

On 5 Dec 2006 01:03:53 -0800, "RichardSchollar"
wrote:

Frank

You can do it all within the TEXT function (altho Biff's comments re
text still stand (obviously)) - maybe you should hide the column
containing the numeric and place the text formula in the immediately
adjacent column? That way you wouldn't impact any existing formulas:

=TEXT(B1-A1,"d \d\a\y\s" & CHAR(10) & "h \h\o\u\r\s")

and remember to format the cell for wrapped text.

Richard



T. Valko wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 340
Default Custom format (time) and wrapping text in a cell

If you need the result as a number, try entering:

=A2-A1

and then format cells with a custom number format: d "days" h "hours".

You can press ctrl+j in the format cells dialog box to place a line
break between the s and the quote.

If there are more than 31 days between start and end date you could try
instead:

=100*INT(A2-A1)+24*MOD(A2-A1,1)

with number format: 0 "days" 00 "hours" and press ctrl+j to put a line
break after days and before the quote.

Phrank wrote:

Thanks Biff and Richard,

Yes, I need the end result in further calculations, so the text route
won't work. Thank you for your input anyway, I appreciate that.

Frank

On 5 Dec 2006 01:03:53 -0800, "RichardSchollar"
wrote:

Frank

You can do it all within the TEXT function (altho Biff's comments re
text still stand (obviously)) - maybe you should hide the column
containing the numeric and place the text formula in the immediately
adjacent column? That way you wouldn't impact any existing formulas:

=TEXT(B1-A1,"d \d\a\y\s" & CHAR(10) & "h \h\o\u\r\s")

and remember to format the cell for wrapped text.

Richard



T. Valko wrote:

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




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 153
Default Custom format (time) and wrapping text in a cell

Excellent Lori! Thank you so very very much!

Frank

On 5 Dec 2006 03:03:01 -0800, "Lori"
wrote:

If you need the result as a number, try entering:

=A2-A1

and then format cells with a custom number format: d "days" h "hours".

You can press ctrl+j in the format cells dialog box to place a line
break between the s and the quote.

If there are more than 31 days between start and end date you could try
instead:

=100*INT(A2-A1)+24*MOD(A2-A1,1)

with number format: 0 "days" 00 "hours" and press ctrl+j to put a line
break after days and before the quote.

Phrank wrote:

Thanks Biff and Richard,

Yes, I need the end result in further calculations, so the text route
won't work. Thank you for your input anyway, I appreciate that.

Frank

On 5 Dec 2006 01:03:53 -0800, "RichardSchollar"
wrote:

Frank

You can do it all within the TEXT function (altho Biff's comments re
text still stand (obviously)) - maybe you should hide the column
containing the numeric and place the text formula in the immediately
adjacent column? That way you wouldn't impact any existing formulas:

=TEXT(B1-A1,"d \d\a\y\s" & CHAR(10) & "h \h\o\u\r\s")

and remember to format the cell for wrapped text.

Richard



T. Valko wrote:

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

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 153
Default Custom format (time) and wrapping text in a cell

Hi again Lori,

I put this to the test at work, and overall it did work. However,
with this custom format, the row doesn't 'autofit', meaning it doesn't
grow in height in response to the split line. And if I increase the
height manually and then try to reduce the width of the column (which
is what this is all about, in order to save space), I get the #######
until I increase the width back to the same size as it takes to put
the contents on one line. Why is that?

Frank


On 5 Dec 2006 03:03:01 -0800, "Lori"
wrote:

If you need the result as a number, try entering:

=A2-A1

and then format cells with a custom number format: d "days" h "hours".

You can press ctrl+j in the format cells dialog box to place a line
break between the s and the quote.

If there are more than 31 days between start and end date you could try
instead:

=100*INT(A2-A1)+24*MOD(A2-A1,1)

with number format: 0 "days" 00 "hours" and press ctrl+j to put a line
break after days and before the quote.

Phrank wrote:

Thanks Biff and Richard,

Yes, I need the end result in further calculations, so the text route
won't work. Thank you for your input anyway, I appreciate that.

Frank

On 5 Dec 2006 01:03:53 -0800, "RichardSchollar"
wrote:

Frank

You can do it all within the TEXT function (altho Biff's comments re
text still stand (obviously)) - maybe you should hide the column
containing the numeric and place the text formula in the immediately
adjacent column? That way you wouldn't impact any existing formulas:

=TEXT(B1-A1,"d \d\a\y\s" & CHAR(10) & "h \h\o\u\r\s")

and remember to format the cell for wrapped text.

Richard



T. Valko wrote:

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

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
How do I wrap text in more than one cell at a time? Elizabeth A. Excel Discussion (Misc queries) 9 August 20th 09 09:57 PM
text wrapping in Excel 2003 Tia Excel Discussion (Misc queries) 10 April 5th 07 10:36 AM
I am using wrap text in excel, so why isn't all my text wrapping? GatorDawg123 Excel Discussion (Misc queries) 2 May 6th 06 05:52 PM
Row Expansion Susan Excel Worksheet Functions 11 February 28th 06 07:15 PM
Text Wrapping JMB Excel Discussion (Misc queries) 0 July 29th 05 02:41 AM


All times are GMT +1. The time now is 06:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"