cell reference within text (decimal place)

beelzebubble

Board Regular
Joined
Jun 11, 2009
Messages
68
Hi,

This should be easy, but I can't seem to figure it out. I simply want to set the decimal place to 0 for a cell reference (which contains a numerical value based on a formulated calculation) within a block of text. Specifically, I've got the command below within cell F14.


="The percentage of people who said 'Yes' is equal to "&B15&"%."


It works fine, except that the cell reference value has way too many decimal places. That is, it produces the following:


The percentage of people who said 'Yes' is equal to 21.754152254656%.


I want it to produce:

The percentage of people who said 'Yes' is equal to 22%.


Thanks for any help
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
="The percentage of people who said 'Yes' is equal to "&Round(B15,0)&"%."
?
 
Upvote 0
Is B15 formatted as Percentage?

Here's another one:

="The percentage of people who said 'Yes' is equal to "&TEXT(B15,"0%")
 
Upvote 0
Curiously, when I run the formula as a macro:

Code:
Range("Sheet4!F14") = "=The percentage of people who said Yes is " & Round(B14, 0) & "%."

it produces an error.

If I try

Code:
Range("Sheet4!F14") = "The percentage of people who said Yes is " & Round(B14, 0) & "%."

It produces:

'The percentage of people who said Yes is 0%?'

Is there something 'special' that must be specified when the text is a combination of text and cell reference/formula? I've tried Range("Sheet4!F14").Formula, but that didn't work, amongst other things.

Any ideas?
 
Last edited:
Upvote 0
try
Code:
Range("Sheet4!F14").Formula = _
"=""The percentage of people who said Yes is""&Round(B14, 0)&""%.""
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top