ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   changing format code?? please help!!! (https://www.excelbanter.com/excel-discussion-misc-queries/203713-changing-format-code-please-help.html)

laandmc

changing format code?? please help!!!
 
How do you if youre referencing a cell in the middle of txt set the amount
of decimal places it uses.

Example

a b
1 average 41.333333 days 41.3

Cell A1 has the function: =€¯average €¯&B1&€¯ days€¯
B1 actual value is 41.333333 with a format of 1dp.

I want to get the outcome

a b
1 average 41.3 days 41.3

Is there a way to do this.


Mike H

changing format code?? please help!!!
 
Try

="Average "&TEXT(B1,"0.00")&" days"

Mike

"laandmc" wrote:

How do you if youre referencing a cell in the middle of txt set the amount
of decimal places it uses.

Example

a b
1 average 41.333333 days 41.3

Cell A1 has the function: =€¯average €¯&B1&€¯ days€¯
B1 actual value is 41.333333 with a format of 1dp.

I want to get the outcome

a b
1 average 41.3 days 41.3

Is there a way to do this.


Gord Dibben

changing format code?? please help!!!
 
="average " & TEXT(B1,"#,##0.0") & " days"


Gord Dibben MS Excel MVP


On Wed, 24 Sep 2008 03:21:01 -0700, laandmc
wrote:

How do you if you’re referencing a cell in the middle of txt set the amount
of decimal places it uses.

Example

a b
1 average 41.333333 days 41.3

Cell A1 has the function: =”average ”&B1&” days”
B1 actual value is 41.333333 with a format of 1dp.

I want to get the outcome

a b
1 average 41.3 days 41.3

Is there a way to do this.




All times are GMT +1. The time now is 01:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com