# cell reference within text (decimal place)

#### beelzebubble

##### Board Regular
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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
L

#### Legacy 68668

##### Guest
="The percentage of people who said 'Yes' is equal to "&Round(B15,0)&"%."
?

#### T. Valko

##### Well-known Member
Is B15 formatted as Percentage?

Here's another one:

="The percentage of people who said 'Yes' is equal to "&TEXT(B15,"0%")

#### beelzebubble

##### Board Regular
Thanks (yet again), Seiya.

#### beelzebubble

##### Board Regular

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:
L

#### Legacy 68668

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

#### beelzebubble

##### Board Regular
That did the trick. Cheers, Seiya.

L

#### Legacy 68668

##### Guest
Oops, I think I missed one " at the end...

Replies
2
Views
198
Replies
7
Views
226
Replies
3
Views
153
Replies
6
Views
306
Replies
3
Views
188

1,141,858
Messages
5,709,035
Members
421,606
Latest member
Faisel135

### 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.

### Which adblocker are you using?

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

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