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

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
Joined
May 9, 2009
Messages
16,623
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
Joined
Jun 11, 2009
Messages
68

ADVERTISEMENT

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)&""%.""
 

Forum statistics

Threads
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.
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
Top