# 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

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
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
136
Replies
7
Views
145
Replies
3
Views
135
Replies
6
Views
262
Replies
3
Views
102

1,136,790
Messages
5,677,745
Members
419,718
Latest member
ALWP

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