ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Calculation within Text (https://www.excelbanter.com/excel-worksheet-functions/56188-calculation-within-text.html)

GeorgeF

Calculation within Text
 

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.


--
GeorgeF
------------------------------------------------------------------------
GeorgeF's Profile: http://www.excelforum.com/member.php...o&userid=24124
View this thread: http://www.excelforum.com/showthread...hreadid=486210


Niek Otten

Calculation within Text
 
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

--
Kind regards,

Niek Otten

"GeorgeF" wrote in
message ...

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.


--
GeorgeF
------------------------------------------------------------------------
GeorgeF's Profile:
http://www.excelforum.com/member.php...o&userid=24124
View this thread: http://www.excelforum.com/showthread...hreadid=486210




Bob Phillips

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

--

HTH

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


"GeorgeF" wrote in
message ...

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.


--
GeorgeF
------------------------------------------------------------------------
GeorgeF's Profile:

http://www.excelforum.com/member.php...o&userid=24124
View this thread: http://www.excelforum.com/showthread...hreadid=486210




SteveG

Calculation within Text
 

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,

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=486210


Ron Rosenfeld

Calculation within Text
 
On Fri, 18 Nov 2005 09:28:46 -0600, GeorgeF
wrote:


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

GeorgeF

Calculation within Text
 

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


--
GeorgeF
------------------------------------------------------------------------
GeorgeF's Profile: http://www.excelforum.com/member.php...o&userid=24124
View this thread: http://www.excelforum.com/showthread...hreadid=486210


Bob Phillips

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

Bob


"GeorgeF" wrote in
message ...

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


--
GeorgeF
------------------------------------------------------------------------
GeorgeF's Profile:

http://www.excelforum.com/member.php...o&userid=24124
View this thread: http://www.excelforum.com/showthread...hreadid=486210





All times are GMT +1. The time now is 07:02 PM.

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