# 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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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
88
Replies
7
Views
75
Replies
3
Views
110
Replies
6
Views
205
Replies
9
Views
566

1,133,243
Messages
5,657,578
Members
418,401
Latest member
B_A_M155

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