Calculation within Text

G

GeorgeF

I have a calculation inserted within a line of text. I'm using the
following: ="Text1"&A10&"Text2" The Text is printing fine, but how do
I control the number of digits to the right of the decimal that are
displayed by A10? A10 is a calculation of two other cells that
periodically change in value and have variable decimal length.
 
N

Niek Otten

Hi George

="Text1"&TEXT(A10,"#.00")&"Text2"

Or use some other formatting string; examples can be found in the Format
menu, if you choose Custom
 
B

Bob Phillips

="Text1"&TEXT(A10,"#,##0.00")&"Text2"

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
S

SteveG

Try using the ROUND function:

=("Text 1"&ROUND(A23,2)&"Text 2")

If A23 were 20.77777 it would only round out to 2 places and return

Text 120.78Text 2

If you want it to be 20.77 then use ROUNDDOWN instead of ROUND

=("Text 1"&ROUNDDOWN(A23,2)&"Text 2") returns

Text 120.77Text 2

Cheers,

Stev
 
R

Ron Rosenfeld

I have a calculation inserted within a line of text. I'm using the
following: ="Text1"&A10&"Text2" The Text is printing fine, but how do
I control the number of digits to the right of the decimal that are
displayed by A10? A10 is a calculation of two other cells that
periodically change in value and have variable decimal length.

Take a look at the TEXT worksheet function HELP information. You can use any
acceptable 'custom' format.

eg:

="Text1"& TEXT(A10,"0.00") &"Text2"


--ron
 
G

GeorgeF

Thanks to: SteveG, Niek Otten, Bob Phillips and Ron Rosenfeld,
This sounds like almost too small problem to throw out to you
great problem solvers. It has been bothering me for some time as I have
fumbled with various non-solutions. Now I have multiple answers.
Thanks to all again.
GeorgeF
 
B

Bob Phillips

You can tell by the multitude of responses that we were more than happy to
help :))

Bob
 
Top